1、Do[{ While | Until } & lt; Cycle condition >; ]
< ring body >
ring
In this form, the condition is first judged, and if the condition is met, the loop body is executed.
Example: Private Sub-Form _Click ()
Dim i is an integer and sum is an integer.
i= 1
Until I> 10
Sum = sum +i
i=i+ 1
ring
Print "1+2+...+ 10="; total
End joint
Step 2: do it
< ring body >
Loop [{while | until} < Cycle condition >; ]
In this form, the loop body is executed first, and it is judged whether the conditions are met after each execution (that is, the loop body is executed at least once).
Example: Private Sub-Form _Click ()
Dim i is an integer and sum is an integer.
i= 1
do
Sum = sum +i
i=i+ 1
Loop until i> 10.
Print "1+2+...+ 10="; total
End joint