Looping in asp

Soldato
Joined
18 Oct 2002
Posts
9,044
Location
London
I have a loop:

Code:
For i=0 To Ubound(myarray,2)
	response.write myarray(0,i)
Next

But I want to do something special if the array reaches the 4th element in the array.
if i=3 then blah would be fine, but I need it for every 4th element.
Is there a quick way of doing this?

I tried with the vbscript MOD function, but can't seem to get any remainder that means it is always the 4th element out of the array.

Any ideas? :)
 
Ahh I must've been doing it wrong. Thanks! :)
Although it was = 3.

i=0 --- i mod 4=0
i=1 --- i mod 4=1
i=2 --- i mod 4=2
i=3 --- i mod 4=3
i=4 --- i mod 4=0
i=5 --- i mod 4=1
i=6 --- i mod 4=2
i=7 --- i mod 4=3
i=8 --- i mod 4=0
 
Back
Top Bottom