how to break/continue a for loop? [modified]
-
"end for" can break a for loop. but how to continue a for? for example:
For i =0 to 10 if(i =4) continue Response.write(i) Next
the result should be: 012356789 But how to do it in vb?? -- modified at 5:30 Thursday 17th August, 2006 -
"end for" can break a for loop. but how to continue a for? for example:
For i =0 to 10 if(i =4) continue Response.write(i) Next
the result should be: 012356789 But how to do it in vb?? -- modified at 5:30 Thursday 17th August, 2006That looks like perfectly good VB to me, except that I thought you needed 'then' and continue on the same line, unless you put end for. Another way would be if (i<>4) then Response.Write(i)
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
"end for" can break a for loop. but how to continue a for? for example:
For i =0 to 10 if(i =4) continue Response.write(i) Next
the result should be: 012356789 But how to do it in vb?? -- modified at 5:30 Thursday 17th August, 2006 -
"end for" can break a for loop. but how to continue a for? for example:
For i =0 to 10 if(i =4) continue Response.write(i) Next
the result should be: 012356789 But how to do it in vb?? -- modified at 5:30 Thursday 17th August, 2006If you have a textbox named Text1 in your form(VB), then this will do the job For i=0 To 10 If i=4 then GoTo ss End If Text1.Text=Text1.Text & i ss: Next