Do Loops

The Do...Loop allows you to execute a block of statements an indefinite number of times. The variations of the Do...Loop are Do While, Do Until, Do Loop While, and Do Loop Until.

Do While

Do While|Until condition

statement(s)...

[Exit Do]

statement(s)...

Loop

Do Until

Do Until condition

statement(s)...

Loop

Do Loop While

Do

statements...

Loop While condition

Do Loop Until

Do

statements...

Loop Until condition

Do While and Do Until check the condition before entering the loop, thus the block of statements inside the loop are only executed when those conditions are met. Do Loop While and Do Loop Until check the condition after having executed the block of statements thereby guaranteeing that the block of statements is executed at least once.