Click to See Complete Forum and Search --> : For Loops


sniper
11-14-2005, 02:58 PM
I have to change javascript for loops to asp for loops. I'll give an example as to what I've been doing.

[javascript]

for(var x=0;x<0;x++)

[asp]
dim x:x=0
for x<0
//some code//
x++
next

The only problem is that I realized that I've been forgetting to put the to at the end of statement. My question is, what do I put after the to if my original loop is all used up?

Any help would be appreciated.

lmf232s
11-14-2005, 03:42 PM
For i = 1 to 10
if i = 5 then
Exit For
End if
Next

Do while i < 10
if i = 5 then
Exit Do
End if
i = i + 1
Loop

Ubik
11-14-2005, 03:49 PM
<%
Dim intLoopThing
Dim intMin
Dim intMax
FOR intLoopThing= intMin TO intMax
response.write ("Count: " & intLoopThing& "<br />")
NEXT
%>