for do...end for


The for do...end for statement runs a group of statements repetitively. The count will start at expr1 and count up until a value equal to or greater than expr2 has been reached. At each increment, all statements between the for do and end for keywords will be acted upon.


for index = expr1 to expr2 {by step_expr} do statements end for


index – An integer or long integer variable used to keep track of the current number of repetitions of the loop. This variable for the loop index must be declared separately.

expr1 – An integer value that’s the minimum value of index. The count will start at this number.

expr2 – An integer value that’s the maximum value of index. The for loop will stop counting when index passes this number.

by step_expr – The integer specifying the amount by which the index variable will be incremented during each pass through the loop. Only positive step values are supported at this time. If this increment amount isn’t stated, the loop will be incremented by one at each repetition.

statements – any valid sanScript statement or statements.

Documentation Feedback