| Home | Previous Lesson: DO UNTIL...LOOP Next Lesson: DO �LOOP UNTIL |
In both DO WHILE and DO UNTIL, condition is specified before the statements block and it is evaluated before the statements are executed. That means if you want the statements block to be executed at least once, then the expression should return true at least for the first time.
DO
statement block
LOOP WHILE expression
In DO�LOOP WHILE, the expression is placed at the end of the loop. This type of statement is useful in places where the statements block needs to be executed at least once even before the expression is evaluated. When this statement is used, the commands are executed first and the expression is evaluated at the end of the command block execution and statement block is executed as long as the expression returns true.
| Home | Previous Lesson: DO UNTIL...LOOP Next Lesson: DO �LOOP UNTIL |