for
|
Batch language command
|
|
The general 'for' loop construct. Very much like the C 'for'. Init consists of one statement (typically assignment). Cond is a logical statement (compound in general). Incr is the statement executed at the end of each loop iteration.
|
Syntax
|
for(Init;Cond;Incr){ ..body..}
|
Notes
|
Since '++' is not supported, statements like i=i+1 should be used in the Incr part.
Construcr for (..;..;..); is invalid, the {..body..} part must be present.
|
Examples
|
for (i=0; i<60; i=i+1)
{
for(j=i+1;j<61;j=j+1)
{ mx[i][j]:=a;
mx[j][i]:=b;
}
}
|
|
Last modified: 8/19/2002 |