Top "For-loop" questions

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

Breaking a "for" loop using "break" considered harmful?

Some days ago I started a quick open source project and, when some mates looked at the code on svn, …

c++ loops for-loop goto break
Can I loop through a javascript object in reverse order?

So I have a JavaScript object like this: foo = { "one": "some", "two": "thing", "three": "else" }; I can loop this like: …

javascript object for-loop properties reverse
Matlab - insert/append rows into matrix iteratively

How in matlab I can interactively append matrix with rows? For example lets say I have empty matrix: m = []; and …

matlab for-loop matrix insert rows
PL/SQL Inserting 1 row for each result in a select

I am writing a PL/SQL Procedure that performs a select based on input variables and then inserts a row …

plsql for-loop insert procedure
How can I convert a JavaScript for-loop to CoffeeScript?

for (i = 0; i < 10; i++) { doStuff(); } That's the JavaScript code that I Want to convert to CoffeeScript.

for-loop coffeescript
How to create and fill a list of lists in a for loop

I'm trying to populate a list with a for loop. This is what I have so far: newlist = [] for x …

python list for-loop nested-lists
How can I break an outer loop with PHP?

I am looking to break an outer for/foreach loop in PHP. This can be done in ActionScript like so: …

php for-loop nested-loops break
Break for loop in an if statement

Currently having trouble with breaking this for loop. I want to break it if the variable is not found in …

python list if-statement for-loop break
Python - Read second column from file

My input file has two columns. I am trying to print the second column of inputdata1.txt within a second …

python for-loop file-io readfile
Loop over tuples in bash?

Is it possible to loop over tuples in bash? As an example, it would be great if the following worked: …

bash for-loop