Purpose 
Executes a group of subcommands while a conditional expression is TRUE or until a conditional expression evaluates to TRUE. 
Syntax 
Do While Condition Commands...Loop 
Do Until Condition Commands...Loop 
Do Commands...Loop While Condition 
Do Commands...Loop Until Condition 
When a loop reaches its last subcommand, the conditions (Condition) of the loop are re-evaluated. The loop then either iterates or processing continues at the first line after the loop. There are four types of Do...Loops (Do While...Loop, Do Until...Loop, Do...Loop While, Do...Loop Until). Each serves a different purpose. The main difference between the two While and Until loops is in the location of the condition. 
 Do...Loop...Condition commands always execute the subcommands at least once, even if the condition indicates that the loop should not iterate. Do While/Until Condition...Loop commands only execute the subcommands if the condition indicates that the loop should iterate. Loops using While iterate while the condition is TRUE. Loops using Until iterate until the condition evaluates to TRUE. 
Example 
Do While Score < 10 
        Print Score 
        Loop 
Do 
        Print Score 
        Loop Until Score > 10 
Both loops accomplish the same result. 
 |