CitectVBA Programming Reference > Understanding CitectVBA Language Basics > Control Structures > Do statement

Do statement

The Do...Loop conditional statement 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|Until <condition>
<statement/s>
Loop

Do Until <condition>
<statement/s>
Loop

Do
<statement/s>
Loop While <condition>

Do
<statement/s>
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 so that the block of statements is executed at least once.

Any Do statement can be exited using the Exit Do statement.

See Also

Control Structures