pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

index
is a value that increments or decrements automatically.
In Standard (page 214), index is the identifier of an INT or INT(32) simple variable, array element,
simple pointer, or structure data item.
In Optimized (page 214), index is the identifier of an index register you have reserved with the
USE (page 232).
initial-value
is an arithmetic expression (such as 0) that initializes index. If index is INT, initial-value
is INT. If index is INT(32), initial-value is INT(32).
TO
increments index each time the loop executes until index is greater than or equal to limit,
at which point the loop stops.
DOWNTO
decrements index each time the loop executes until index is less than or equal to limit,
at which point the loop stops.
limit
is an arithmetic expression that terminates the loop. If index is INT, initial-value is
INT. If index is INT(32), initial-value is INT(32).
step
is an arithmetic expression by which to increment or decrement index each time the loop
executes. If index is INT, then step is INT; otherwise, index is INT(32). The default is 1.
statement
is any statement described in this section.
The FOR statement tests index at the beginning of each iteration of the loop. If index exceeds
limit on the first test, the loop never executes.
Topics:
Nested (page 213)
Standard (page 214)
Optimized (page 214)
Nested
You can nest FOR statements to any level.
The nested FOR statement in Example 157 (page 214) uses multiples as a two-dimensional
array. It fills the first row with multiples of 1, the next row with multiples of 2, and so on.
FOR 213