Please enable JavaScript to view this site.

A-Shell Consolidated Reference

REPEAT

REPEAT is similar to EXIT in that it can occur inside a DO loop, a FOR...NEXT loop, or FOREACHloop; it causes the control to transfer to the next iteration of the current loop without executing any remaining statements in the body of the current loop. For example:

TOT = 0

FOR I = 1 TO 10

    IF I = 5 REPEAT

    TOT = TOT + I

NEXT I

 

The above loop would set TOT to the sum of all the numbers 1 through 10, except 5.

The compiler supports the REPEAT statement when compiling in X:1 or X:2 or /RC mode.