16-Do While

0
294


Do While loop
can have one or more conditions in its expression. In performing it, you have to use a special syntax form. This syntax form gives a way to continue performing while one or more conditions are true.

 

This is the syntax in doing Do While Loop.

  1. Do While [counter] >= [start #]  And  [counter]  <= [start #]
  2.  
  3. statements.....
  4. Loop

Example.

  1. Dim i As Integer = 100
  2. Dim z As Integer = 0
  3.  
  4. Do While i >= 0 And z <= 20
  5.  
  6. i = i - 10
  7. z = z + 3
  8.  
  9. MsgBox(i & " " & 3)
  10. Loop

 

 

Readers might read also:

 

 

 

Facebook Comments
(Visited 15 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here