Examples and operator structure
Typical examples of REPEAT cycle, available in "COMPAS" are the following:
- REPEAT i := i + 1 UNTIL s[i] = '#';
- REPEAT s := s + a; a := a + 1 UNTIL a < 10;
- REPEAT READ(c) UNTIL c='.';
- REPEAT w := w-1; b := w=0 UNTIL b;
Possible structures of this operator can be written the following way:
REPEAT {operator} UNTIL {condition} ;
REPEAT {operator} UNTIL {BOOLEAN variable} ;
Note, in the case of REPEAT cycle you have no need to
use reserved words BEGIN and END to group cycle body operators.

Back to: