Miklos Cserzo wrote:
"repeat" is reserved word in all Pascal dialects for creating loops in the
^a
program execution. The statements after the "repeat" executed
^are
sequentially. When the "until" statement reached the execution continues
^is
with the next statement if the boolean expression evaluates "true". If it is "false" the execution continues at the next statement after the
^^^^first(?)
starting "repeat" of the loop and the enclosed statements will be executed again.
The statements in the loop will be executed at least once. If the expression in the "until" statement always "false" the execution falls
^is
into infinite loop.
^an
It is allowed the create nested "repeat - until" loops where the closest
^^^to
.... repeat { echo the input from "infile" to "outfile" } readln(infile,buffer); writeln(outfile,buffer); until eof(infile); close(infile); close(outfile); ....
IMHO a bad example for repeat, better suited for a while loop, since infile can be empty.