In addition to the FOR NEXT statement(s) discussed previously, there are two more logical flow controlling statements.
The first is WHILE ENDWHILE. If the variable or data provided is TRUE, the code will execute. If it is FALSE, then WHILE will jump to the ENDWHILE and the loop will end.
In this example, the loop will execute only once. If it had been WHILE TRUE, there would have been an infinite loop which could only be stopped by pressing [ESC] on the keyboard.
The second logical flow control statement(s) is REPEAT UNTIL. Unlike WHILE ENDWHILE which may never execute, REPEAT UNTIL will always execute its loop at least once. When the variable or data provided at UNTIL is TRUE, the loop will end.
In this example, the loop will execute only once. If DONE had been assigned FALSE, the loop would be infinite and would require the pressing of [ESC] on the keyboard to end.