The reserved word repeat is used as a loop instruction where the test occurs after the loop is executed. It is a control construct that is similar to a {{HL|while}}-{{HL|do}} loop.
Syntax
repeat
<statement block>
until <condition>;
- <statement block>: One or more Pascal statements. The repeat-until construct is a block statement, so a {{HL|begin}}-{{HL|end}} statement block is not required.
- <condition>: Expression that evaluates to a
booleanvalue.
Example
x := 1;
repeat
DoSomethingHere(x);
x := x + 1;
until x = 10;
Keywords: begin — do — else — end — for — if — repeat — then — until — while