ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

16-Do While

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

 

Facebook Comments

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!