Low cost ecommerce web development India flash website design
Let us take a case of nested loops to clarify things:
<%
For I = 1 to 8
For j =1 to 8
Response.Write “X”
Next
Response.Write vbCrLf
Next
%>
This will draw a nice chessboard pattern on the screen. (You will need to
view the source of the page in your browser however. If you look at the page
in the browser itself, you will not see the true result. More about that later.)
A very important point to note is that the Next statement that completes the
For does not take an argument. You cannot say:
Next I
Or
Next J
This is invalid. Each Next statement encountered is automatically assumed to
complete the immediately preceding For statement.
stepsize
of the For-loop variable.
<%
For I = 1 to 10 Step 2
Response.Write “Number = ” & I & vbCrLf
Next
%>
gives you:
Number = 1
Number = 3
Number = 5
Number = 7
Number = 9
The loop counted I in steps of 2, thus taking on only odd values from the
entire set of 10.
Freelance web designer ASP PHP ecommerce web development India