Jump to content

Break Out Of A Select?


MattNis
 Share

Recommended Posts

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]

Link to comment
Share on other sites

  • Developers

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.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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".

Link to comment
Share on other sites

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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...