Top "For-loop" questions

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

How can I break a for loop in jinja2?

How can I break out of a for loop in jinja2? my code is like this: <a href="#"> {% …

python for-loop jinja2
How do I declare several variables in a for (;;) loop in C?

I thought one could declare several variables in a for loop: for (int i = 0, char* ptr = bam; i < 10; i++) { ... } …

c loops for-loop declaration
Why can't you use cat to read a file line by line where each line has delimiters

I have a text file that contains something like this: abc 123, comma the quick brown fox jumped over the lazy …

linux bash for-loop cat
Exit in For loop - Windows Command Processor (CMD.EXE)

I am trying to find way to break / exit from FOR loop, if there are any error occured. Below is …

command-line for-loop cmd control-flow
How to use setInterval function within for loop

I'm trying to run multiple timers given a variable list of items. The code looks something like this: var list = …

javascript for-loop closures setinterval
Print output of cat statement in bash script loop

I'm trying to execute a command for each line coming from a cat command. I'm basing this on sample code …

linux bash for-loop cat
Need iterator when using ranged-based for loops

Currently, I can only do ranged based loops with this: for (auto& value : values) But sometimes I need an …

c++ c++11 for-loop iterator
"for" loop in velocity template

I already posted a similar question a week ago on How to use 'for' loop in velocity template?. So...basically …

loops for-loop velocity
Finding GCD of Array Code C language

I am trying to write a program in C. The program is supposed to find the GCD (greatest common divisor) …

c arrays for-loop greatest-common-divisor
Function to loop through and select data from multiple tables

I'm new to Postgres and have a database with multiple tables of the same structure. I need to select data …

postgresql for-loop plpgsql dynamic-sql set-returning-functions