Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to exit from a For?
Message
From
22/05/2001 18:44:40
 
 
To
22/05/2001 14:39:25
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00509972
Message ID:
00510128
Views:
21
>>How can we exit from a For loop in ASP? This assumes that instead of using a Do loop until a specific condition is reached that I am using a For loop instead with a high value so it'll loop until a specific condition is reached. Then, I would issue an Exit command to exit from the For loop. However, Exit does not work. What can I use to exit from a For loop or should I always use a Do loop instead when I have such a need? I did use the Do loop in my code however I am wondering if I ever use a For loop then I would need to know how to exit from it.>>>>>>>>>
>
>
>
>For n = 1 to 10
>   If MyCondition = True Then
>      Exit For
>   End if
>Next n
>
So, basically, it's the same approach as Exit Sub. Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform