Home > Language Reference > Program Flow Functions > Repeat

Repeat

The Repeat...Until statement repeats the statements included in the loop until the condition is True. 

Usage

Used to to repeat the same steps.

Syntax

Repeat
     <statements>
    Until <boolean_expression>

Parameters

<boolean_expression>, boolean. The result of the expression must be True or False.
<statements> are executed until the expression is True.

Remarks

If PAUSE n SECS or PAUSE n TICKS is the last line before UNTIL, use EndPause function to close this Pause block, or the Compiler will return a compilation error.

See also

Logical Operators
While

Example

 a = 0
 Repeat
      beep (100)
      a = a + 1
      Pause 300 ticks 'Same as Pause 3 secs
      EndPause        'EndPause is needed to avoid a Pause line just above an Until line
 Until a = 5