Jump to content
Sign in to follow this  
MattNis

Break Out Of A Select?

Recommended Posts

MattNis

What's the syntax for breaking out of a Select...case.... structure?

such that if one of the case statements has been satisfied, I could just skip the rest of the checks

thanks


[quote]I was busy waiting all night for the Columbus Day Bunny to come down my chimney and light fireworks in my pumpkin.There's so much wrong with that.Oh, I'm sorry, i forgot you were Jewish.[/quote]

Share this post


Link to post
Share on other sites
Jos

Think thats a feature already... :whistle:

from the helpfile:

If the expression is true the following statements up to the next Case or EndSelect statement are executed. If more than one of the Case statements are true, only the first one is executed.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Valik

I think the select structure only matches one case, regardless if any of the following cases also match. You might test this with something like:

Select
    Case 1 = 1
        MsgBox(4096, "", "First Case")
    Case 2 = 2
        MsgBox(4096, "", "Second Case")
EndSelect

I think that you should only see the message box which says "First Case".

Share this post


Link to post
Share on other sites
MattNis

Thanks,

I wasn't sure, but I thought that some post in the "old forum" said they all get evaluated.


[quote]I was busy waiting all night for the Columbus Day Bunny to come down my chimney and light fireworks in my pumpkin.There's so much wrong with that.Oh, I'm sorry, i forgot you were Jewish.[/quote]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.