lothos12345 Posted March 20, 2004 Posted March 20, 2004 Is there a way to exit and if statement for example Do while <variable> <> <criteria> If <variable> = true then <problem here> Else Perform program operations here! End if Loop I want to exit the if statement without exiting the Do While Loop. Is there a way I can do this? Any help with this is greatly apprieciated. Quote
georgepatotk Posted March 20, 2004 Posted March 20, 2004 Do while <variable> <> <criteria> If <variable> = true then <problem here> Else Perform program operations here! End if Loop I am wondering why do you need to exit if?? Just leave the condition, then it will do nothing, If variable <> criteria 'do nothing, in other word, already exit else 'do something end if Quote George C.K. Low
Moderators Robby Posted March 20, 2004 Moderators Posted March 20, 2004 As George said "why do you need to exit if", perhaps restructure your If condition or add more to it. Quote Visit...Bassic Software
*Experts* Bucky Posted March 20, 2004 *Experts* Posted March 20, 2004 If you're just going to have series of If...ElseIf statements, then maybe a Select Case statement might fit the situation better. Only one Case is ever executed, and the Select statement is "exited" after the first true case is found. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Alex29 Posted April 19, 2012 Posted April 19, 2012 If you really want this the try block can accomplish it. Not very elegant but it would do what you want If Nbr > 1 then Try Do some statements If Nbr > 10 then Exit Try End If Do some more statements Catch End Try End If Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.