up previous next
repeat    --    loop command


Syntax
repeat C until B
repeat C endrepeat
(where C is a sequence of commands and B is BOOL)

Description
In the first form, the command sequence C is repeated until B evaluates to false . Unlike the while command, C is executed at least once. Note that there is no endrepeat following B .

Example
/**/      Define GCD_Euclid(A, B)
/**/        Repeat
/**/          R := mod(A, B);
/**/          A := B;
/**/          B := R;
/**/         Until B = 0;
/**/        Return A;
/**/      EndDefine;

/**/  GCD_Euclid(6,15);
3

/**/  N := 0;
/**/  repeat
/**/    N := N+1;
/**/    PrintLn N;
/**/    If N > 5 Then Break; EndIf;
/**/  endrepeat;
1
2
3
4
5

See Also