Link to home
Start Free TrialLog in
Avatar of eshoris
eshoris

asked on

VB.NET - Looping

I know that there are a variety of looping structures available in VB. such as:

DO.....LOOP

WHILE.....WEND

FOR.....NEXT

I'm so confused with looping structures, can someone please explain.


Avatar of bkthompson2112
bkthompson2112

Do Loop:

Do
  statements
Loop While condition

The condition test occurs after the loop statements have been executed,
so statements will always be executed at least once.

While Wend:

While condition
  statements
Wend

The condition test occurs before the loop statements have been executed,
so statements may not be executed at all.  (Depending on the condition.)

For Next:

For counter = x to y
  statements
Next

For Next is used when you know how many time the loop will iterate.
ASKER CERTIFIED SOLUTION
Avatar of fatalXception
fatalXception

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial