The repeat statement is used to execute a statement until a certain condition is reached. The statement will be executed at least once. The prototype syntax of the Repeat..until statement is
This will execute the statements between repeat and until up to the moment when Expression evaluates to True. Since the expression is evaluated after the execution of the statements, they are executed at least once.
Be aware of the fact that the boolean expression Expression will be short-cut evaluated by default, meaning that the evaluation will be stopped at the point where the outcome is known with certainty.
The following are valid repeat statements
Note that the last statement before the until keyword does not need a terminating semicolon, but it is allowed.
The Break and Continue system routines can be used to jump to the end or just after the end of the repeat .. until statement. Note that Break and Continue are not reserved words and therefore can be overloaded.