AuthorMessage
Meka][Meka
Unstopable
Posts: 700

ok something for the noobs jus a quick few examples on looping in vb, thers is several ways of looping
1: While loop
Code:

i = 0
While i = 0
    'dosomething
Wend

2: For loop
Code:

For i = 0 To 100
    'dosomething
Next

and the more useful
3: do loop
do loop can be used a couple of ways, constant loop, do loop, or do until
constant loop:
Code:

Do
    'dosomething
Loop

do until:
Code:

Do Until i = 10
    i = i + 1
    'dosomething
Loop

and finally loop until
Code:

Do
    i = i + 1
    'dosomething
Loop Until i = 10

well hope these examples come in handy, any help jus post
-/Meka][Meka
Corayzon
Regular
Posts: 67

Quoted from Meka][Meka

do until:
Code:

Do Until i = 10
    i = i + 1
    'dosomething
Loop


you could also add the incrementer into the do until line with :
ie...
Code:
Do Until i = 10 : i = i + 1
    'dosomething
Loop

^^
Meka][Meka
Unstopable
Posts: 700

Quoted from Corayzon
Quoted from Meka][Meka

do until:
Code:

Do Until i = 10
    i = i + 1
    'dosomething
Loop


you could also add the incrementer into the do until line with :
ie...
Code:
Do Until i = 10 : i = i + 1
    'dosomething
Loop

^^

mmm well this is exactly the same, only using :, it can be used todo anything, even DoEvents, kinda tells the compiler theres an early start
Code:

do : doevents
   'dostuff
loop