LOOP

From ICE Enterprises
Jump to navigation Jump to search

implements a basic counting loop within a macro

 
<count>  Number of times to loop
<label>	 Result label to hold count (optional)

The LOOP loop is a simplified version of the DO loop that is provided for
compatibility with X-Midas.

A LOOP-ENDLOOP combination is used in a macro to loop through a sequence of 
commands <count> number of times. If specified, the results parameter <label>
will contain the current loop count.  When the loop is finished, <label> will
be equal to <count>.

<label> starts at 1 and continues up through <count> inclusively. Thus for
<count>=3, <label> becomes 1, 2, 3, and then the loop stops.

There are no restrictions nesting LOOP loops.

Examples:
  1. Initialize the results MYRES_1 ... MYRES_7.

   LOOP 7 i
     result myres_^i 0
   ENDDO

SEE ALSO:  DO, ENDLOOP, BREAK, CONTINUE