Visual Basic 6.0 - Do While Loop
Visual Basic 6.0 - Do While Loop
STRUCTURE
Definition
The is used
to execute statements until
a certain condition is met.
The Do While loop is perhaps the most common
looping statement that you'll put in Visual
Basic programs. Do While works with comparison
expressions just as the If statement does.
Therefore, the six comparison operators that
you learned about in the previous lesson work
as expected here. Rather than controlling the
one-time execution of a single block of code,
however, the comparison expression controls
the looping statements.
Format
Do While expression
[VB Statements]
Loop
Do
[VB Statements]
Loop While expression
Example
1. Make a program that does not exit while a'
is less than the value of 100. It keeps
adding 1 to a' and when a' reaches 100.
Example :D
Make a program that will accept a grade equal or
greater than 85 using the do while loop statement.