1.Do Loop
|
La disposizione � come segue:
|
a) Do While condition
Block of one or more VB statements
Loop
b) Do
Block of one or more VB statements
Loop While condition
c) Do Until condition
Block of one or more VB statements
Loop
d) Do
Block of one or more VB statements
Loop Until condition
|
|
Il seguente esempio mostra che l'uso di Do Loop in VB
|
Do while counter <=1000
num.Text=counter
counter =counter+1
Loop
or
The above example can be rewritten as
Do
num.Text=counter
counter=counter+1
Loop until counter>1000
|
|
2.For....Next Loop
|
The format is as follows:
|
For counter=startNumber to endNumber (Step increment)
One or more VB statements
Next
|
|
Il seguente esempio mostra l'uso di For....Next Loop in VB
|
(a) For counter=1 to 10
display.Text=counter
Next
(b) For counter=1 to 1000 step 10
counter=counter+1
Next
(c) For counter=1000 to 5 step -5
counter=counter-10
Next
|
|
Keywords:
Looping in VB,
visual basic looping,
asp net looping,
visual basic vb,
vb source code,
while loop in vb,
for loop in vb,
vb asp net,
looping in excel,
looping in sql,
vb array,
vb functions,
looping asp,
vb tutorials,
vb timer,
looping code,
vb dim,
vb code,
vb msgbox,
vb controls,
vb reference,
shell in vb
|