Loop

For...Next Loop

<%
For i = 0 To 5
  response.write("The number is " & i & "<br />")
Next
%>

Step

With theStepkeyword, you can increase or decrease the counter variable by the value you specify.

For i=2 To 10 Step 2
  some code
Next

Exit a For...Next

You can exit a For...Next statement with the Exit For keyword.

For i=1 To 10
  If i=5 Then Exit For
  some code
Next

For Each...Next Loop

<%
Dim cars(2)
cars(0)="Volvo"
cars(1)="Saab"
cars(2)="BMW"

For Each x In cars
  response.write(x & "<br />")
Next
%>

Do...Loop

Do While i>10
  some code
Loop
Do
  some code
Loop While i>10

results matching ""

    No results matching ""