DO...LOOP statement

Top  Previous  Next

Do { While | Until } condition

   [ statements ]

   [ Exit Do ]

   [ statements ]

Loop

 

' -or-

 

Do

   [ statements ]

   [ Exit Do ]

   [ statements ]

Loop { While | Until } condition

 

Repeats a block of statements WHILE a boolean condition is True or UNTIL the condition becomes True.

 

If condition is before statements, then it will be tested before iteration. Otherwise, it will be tested after iteration.

 

Example:

= 0

= ""

Do While True

   If i >= 10 Then

      Exit Do

   End If

   s = s + CStr(i)

   i = i + 1

Loop

 

 




Translate document: