Do Statement
Syntax
Do
Loop
-or-
Do {Until|While} condexpr
Loop
-or-
Do
Loop {Until|While} condexpr
Group
Description
Form 1: Do statements forever. The loop can be exited by using Exit or Goto.
Form 2: Check for loop termination before executing the loop the first time.
Form 3: Execute the loop once and then check for loop termination.
Loop Termination:
- Until condexpr: Do statements until condexpr is True.
- While condexpr: Do statements while condexpr is True.
See Also
Example
Sub Main
I = 2
Do
I = I*2
Loop Until I > 10
Debug.Print I ' 16
End Sub