Continue in "for" loop in asp

Posted by Anu_dgr8 under Others on 3/18/2010 | Views : 9089 | Status : [Member] | Replies : 3
how to write "continue" in "for loop" in asp?

Thanks and Regards,
Hoosha Boosha



Responses

Posted by: SurajRane on: 3/18/2010 [Member] Starter

Up
0
Down
Try this ... !!


DIM continue : continue = true

Do While statement

If (something unwanted) Then
continue = false
END IF

IF continue THEN
'rest of code to execute
END IF

continue = true
'make sure to reset this every round, either at the end or beginning
NEXT


Anu_dgr8, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Syedshakeer on: 3/18/2010 [Member] Starter

Up
0
Down
Hi Anu
check the following link,you will get information withe examples

http://www.tutorialsroom.com/tutorials/details/asp-Net-for-foreach-loops

Syed Shakeer Hussain

Anu_dgr8, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbanerjee on: 4/13/2010 [Member] Starter

Up
0
Down
C# example:
for( int iterator=0 ; iterator<10 ; iterator++)

{
if(iterator==5)
continue;

Page.Response.WriteLine(iterator.ToString());
}


Continue statement goes to next cycle in the loop when it gets executed. In the above xample when the iterator value becomes equal to 5 then it simply ge incremented without executing the WriteLine statement.


Regards,
Soumen

Anu_dgr8, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response