NairnFEAMPM Icon

Repeat Command

The Repeat command can be used to set up loops in the commands. The format for repeat loops, which may be nested is:

Repeat "#x",start,end,<step>
  (commands in the loop)
    ...
  break
    ...
  Repeat "#y",start,end,<step>
    (commands in nested loop)
      ...
    continue
      ...
    Repeat
      (commands in nested continuous loop)
        ...
      breakAll
        ...
    EndRepeat
  EndRepeat
EndRepeat

where

Notes

  1. You can not permanently change the loop variable during a loop. If you change it, it will be reset to the next loop value at the start of the next pass through the loop. For example:
    Repeat "#x",1,5
      Write #x
      #x+=10
    EndRepeat
    
    will write 1,2,3,4,5 on successive lines even though #x was changed in the loop. Each pass through the loop resets #x to the next loop value.