Top "For-loop" questions

A for loop is a control structure used by many programming languages to iterate over a range.

Exit iteration of for loop Swift iOS

I have a function with a for loop inside of it: func example() { // create tasks for link in links { let …

ios swift for-loop return break
How do you find the last loop in a For Each (VB.NET)?

How can I determine if I'm in the final loop of a For Each statement in VB.NET?

vb.net foreach for-loop each
Type 'AnyObject' does not conform to protocol 'SequenceType'

func loadThumbnails() { let paths = NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true) let documentsDirectory:NSString = paths[0] as NSString var error:NSError? let …

xcode for-loop swift xcode6-beta6
Why Is Comparing if an Unsigned Int >= 0 a "Pointless Comparison"?

I got warning: Pe186 "Pointless comparison of unsigned int with zero" when I tried to compile the following code: for(…

c++ c for-loop comparison unsigned
Selenium webdriver window handles c# switchTo failed

Here comes 2 windows pop out during the testing. my code: string BaseWindow = driver.CurrentWindowHandle; ReadOnlyCollection<string> handles = driver.…

c# selenium for-loop webdriver window-handles
bash error renaming files with spaces - mv target is not a directory

I'm trying to rename a bunch of files which contain spaces in them, getting rid of the spaces. I thought …

bash loops for-loop rename mv
ECMAScript 2015: const in for loops

Which of the two (or neither/ both) code fragments below should be working in a complete ECMAScript 2015 implementation: for (const …

javascript for-loop scope constants ecmascript-6
Can I easily iterate over the values of a map using a range-based for loop?

Is it possible to iterate over all of the values in a std::map using just a "foreach"? This is …

c++ dictionary for-loop c++11 key-value
Batch script for loop won't set variable

I have a batch script trying to execute out of anthill to get the folder names containing plsql to be …

for-loop batch-file anthill
What is the most efficient loop in c#

There are a number of different way to accomplish the same simple loop though the items of an object in …

c# loops for-loop foreach while-loop