Sign in to follow this  
Followers 0
eHrgo

Exit a While/Select loop

6 posts in this topic

Hi all,

Thanks for your time:

I have just a little question:

If I have something like:

While 1
$msg=GuiGetmsg()

Select
Case $msg=$save 
;ExitSelect

Case $msg=$close
Exit 0
Endselect

Wend

;My Program..

How can I tell my program to stop the While loop inside the Case $msg=$save function? Go directly to MyProgram .. etc.

Thanks a lot


Sorry for my Bad English.

Share this post


Link to post
Share on other sites



$i=0
While $i<>1
$msg=GuiGetmsg()

Select
Case $msg=$save
$i=1

Case $msg=$close
Exit 0
Endselect

Wend

;My Program..

I solved it by doing this, but its a stupid way to do it. Is there any other official way?


Sorry for my Bad English.

Share this post


Link to post
Share on other sites

Check out ExitLoop in the help file.

Share this post


Link to post
Share on other sites

ExitLoop will break out of a While, Do or For loop.

In my case, I'm in a Select, so it displays me an error if I use it.

Thanks


Sorry for my Bad English.

Share this post


Link to post
Share on other sites

One thing to remember when coding - You have standards in the code, but there is no "official" way. Coding is a art. (A dark art at that) You can say a coder is a artist. It it works, it isn't stupid. There are more efficient ways of doing things at times, then again not.

Po put it another way - "To each his own" the girl said as she kissed the cow....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0