Forms of cycle

The permissible forms of cycle are these: a) %cycle (endless cycle) : %repeat b) %while condition %cycle : %repeat c) %cycle : %repeat %until condition d) %for var = init, inc, final %cycle : %repeat
The unconditional instructions %continue and %exit can be used inside a cycle of any type. %continue causes a branch to the next %repeat; %exit causes a branch to the statement following the next %repeat. Notes on the cycle types: b) %while cycles are executed zero or more times. When the cycle body consists of a single statement, the form statement %while condition can be used. Example: SKIPSYMBOL %while NEXTSYMBOL=' ' The IMP9 form %while condition %then statement is not allowed.
c) %until cycles are executed one or more times. The simple form is statement %until condition The IMP9 form %until condition %then statement is not allowed.
d) %for cycles: the cycle variable must be of type %integer; it should not be changed explicitly within the cycle body; the cycle body is executed (final-init) //inc + 1 times or zero times, whichever is the greater; if the cycle is not executed the cycle variable is set to be unassigned; (final-init) must be exactly divisible by inc. It follows from this that a cycle starting %for I=10,1,8 %cycle will not be executed, but will not be faulted either. This differs from IMP9, where the equivalent form %cycle I=10,1,8 would be faulted. The simple form of %for is statement %for var = init, inc, final Example: A(I)=0 %for I=20,-1,1 [Going down in steps of -1 to 1 happens to be more efficient on EMAS 2900 than the more usual 1,1,20.]