CH 06
CH 06
6.1 Do Loops
6.2 For...Next Loops
6.3 List Boxes and Loops
Do
statement(s)
Loop Until condition
txtAmount
txtWhen
Dim i As Integer = 1
Do While i <= 5
lstTable.Items.Add(i & " " & i ^ 2)
i += 1
Loop
Output: A1
A2
A3
:
© 2017 Pearson Education, Inc.
Hoboken, NJ. All rights reserved. 25
For and Next Pairs
lstStates
lstAges
txtAvgAge
The statements
Do While flagVar = True
and
Do While flagVar = False
can be replaced by
Do While flagVar
and
Do While Not flagVar
© 2017 Pearson Education, Inc.
Hoboken, NJ. All rights reserved. 45
Counters and Accumulators