Repeat - until

Top  Previous  Next

The "repeat" statement has the form:




The "repeat" loop is similar to the "while" loop except that the decision to continue the loop is made after the block.


These flow diagrams show the difference between the "while" and "repeat" statements:



An example of a repeat loop is:


        repeat  InputGuess;


        until Guess = Number


Note that the command words "repeat" and "until" also act as "begin" and "end" for the block in the loop.