ASP : Loop
Loop
For Loop
Basic
For i=0 To 5
response.write i
Next
Step keyword - Increased by 2 each iteration
For i=2 To 10 Step 2
response.write i
Next
Exit For Loop
if i = 3 then exit for
For Each Loop
colorArr = array("blue","red","purple")
For each color in colorArr
response.write "color: " & color
Next
While Loop
Used to loop through a record set.
While NOT rsInfo.EOF
response.write rsInfo("Column_name")
rsInfo.MoveNext
Wend
Do Loop
When iteration count is unknown. Can be used to do at least one iteration. While or Until.
Do Until i=10
i=i+1
If i>10 Then Exit Do
Loop