Code: Select all
REPEAT
...
...
IF Error THEN exit; (* Leave the room NOW!! *)
....
....
UNTIL ...
occurred.
Can't continue with the loop to UNTIL as I have an Error.
Code: Select all
REPEAT
...
...
IF Error THEN exit; (* Leave the room NOW!! *)
....
....
UNTIL ...
Code: Select all
REPEAT
...
IF ~error THEN
...
END
UNTIL ... OR error;
The truly correct way is try to express your algorithm in the form which isn't require mid-exit loops. This is possible & lead to more clearly programs in most cases. Prof Wirth removed LOOP/EXIT statements in the Revised Oberon (Oberon-07) to encourage this way.Helpdesk wrote:What is the 'correct' way to exit a REPEAT...UNTIL loop?