Loops in Vbscript
Here is the list of different looping statements in vbscript.
'You can exit from For Loop with Exit For statement
'For Loop
'You can exit from Do Loop with Exit Do statement
'do while ...loop
'do until ....loop
'You can not exit from while loop using exit statement.
'while........wend
- For ....Next
- For Each ...Next
- Do While...Loop
- Do Until....Loop
- While...Wend
'You can exit from For Loop with Exit For statement
'For Loop
For i=1 to 3 Msgbox i*i Next 'For Each loop a = array(22,33,5,3) For each e in a Msgbox a Next
'You can exit from Do Loop with Exit Do statement
'do while ...loop
i=1 Do while (i<3) Msgbox i*i i=i+1 Loop
'do until ....loop
i=1 Do until i>3 Msgbox i*i i=i+1 Loop
'You can not exit from while loop using exit statement.
'while........wend
i=1 While i<=3 Msgbox i*i i=i+1 Wend
0 comments:
Post a Comment