Recent changes Random page
GAMING
Technology
 
Gaming
Entertainment
Science Fiction
Biggest wikis
Hobbies
Music
See more...

While

From Visual Basic Wiki

Jump to: navigation, search

[edit] While Statement

The code in a while block is executed as long as the conditional expression does not evaluate to False.

[edit] While-Wend Statement

While Dirty
   Self.Clean
Wend

Would mean as long as the "Dirty" is True, "Self" will "Clean"

[edit] Do-While Statement

Sometimes you want the block to be executed at least once.

Dim aName As String
Do
   aName = InputBox("What is your name?")
Loop While aName = ""
MsgBox "Hello " & aName

This would ask for a name, but if they gave nothing it would try again. Then it would say "Hello (Name)".

Flow Control
If | For | While | Do | Until
Rate this article:
Share this article:
.