for <variable> = <start> to <end> [step <step>]
[loopname <loopname>]
"{"
...
"}"
The for command executes a set of commands repeatedly, with a specified variable taking a different value on each iteration. The variable takes the value start on the first iteration, and increases by a fixed value step on each iteration; step may be negative if end
start. If step is not specified then a value of unity is assumed. The loop terminates when the variable exceeds end. The following example prints the squares of the first five natural numbers:
for i = 1 to 5
{
print i**2
}