ITERATE

 ────ITERATE──┬────────┬───;─────────────────
                └──name──┘

ITERATE is used to alter the flow within a repetitive DO loop (that is, any DO construct other than that with a simple DO loop).

Processing of the group of instructions stops, and control is passed to the DO instruction just as though the END clause had been encountered. The control variable (if any) is incremented and tested, as normal, and the group of instructions is processed again, unless the loop is terminated by the DO instruction.

If name is not specified, ITERATE steps the innermost active repetitive loop. If name is specified, it must be the name of the control variable of a currently active loop which may be the innermost loop; this is the loop that is stepped. Any active loops inside the one selected for iteration are terminated (as though by a LEAVE instruction).

Example:

do i=1 to 4
  if i=2 then iterate
  say i
  end
/* Would display the numbers:   1, 3, 4  */

Notes:


[Back: INTERPRET]
[Next: LEAVE]