for <ident> = <start> , <limit> {,<inc>} <command_block>
Loop through one or a block of commands controlled by a numeric variable.
<ident>
A numeric identifier. If it does not exist, a local numeric will be created.
<start>
A numeric expression giving the start value for <ident>.
<limit>
A numeric expression giving the limiting value for <ident>.
<inc>
A numeric expression giving a value by which <ident>
is incremented at the end of every pass of the loop. The default is one.
The loop will stop when <ident>
reaches the value <limit>.
<command_block>
One command or a block of commands to be executed on each iteration.
None
For loops may be downward by giving inc a negative value.
A jump to the end of the for loop may be made with the continue command.
A break out of the for loop may be made with a break command.
Loop of one command.
for x=1,10; array[x] = 5.5
Loop of a command block.
for y=1,10,2 { x = y * y tell <'X,Y have values',x,y> }
Commands: |