SNIPPET - REPEAT

The REPEAT command allows a block of commands to be repeated a specified number of times. The syntax is as follows:

REPEAT <value>
{
  <commands to repeat>
  [ BREAK ]
}

The <value> may be a numeric expression or a literal value. The key word BREAK may be used within the block of commands to force early termination of the loop. (Do not type the square brackets when using the BREAK command – this just denotes that it is optional.)

There is no built-in tracking mechanism to see what iteration you are at within the loop. If you wish to keep track of the number of iterations along the way, you must assign your own variable and increment it manually. See this example:

ASSIGN i=0
REPEAT 10
{
  ASSIGN i=i+1
  <other stuff>
}

Also, keep in mind that the REPEAT command has a built-in time limit of ½ second. This is to protect against abusive looping which costs platform performance. A loop that exceeds this threshold will be aborted.