WHILE is used together with BEGIN and REPEAT to execute some code if a condition is true, end then loop back again. The loop repeats until the condition preceding WHILE is not true.
BEGIN marks the start of the loop. REPEAT will jump to the code just after BEGIN and execute it again.
WHILE checks the condition, and if true, runs the code following it. If the condition is false, it jumps down to the code after REPEAT, and the loop exits.
|