Jump to content
Sign in to follow this  
Ozzzi

MsgBox and Select case expression

Recommended Posts

Ozzzi

Hi all,

A quick query that I couldn't find any more documentation on:

Q: Am I right to assume under the msgbox return value of 1 (OK), nothing is necessary in order to proceed processing the script?

Under the return value of 2, I wish to cancel/exit the script, so I figured exit would do just nicely. However, I couldn't find out what to do for 1; is it bad scripting to leave it blank?

Select
    Case $iMsgBoxAnswer = 1

    Case $iMsgBoxAnswer = 2
        Exit
EndSelect

Many thanks for your time.

Edited by Ozzzi

Share this post


Link to post
Share on other sites
jvanegmond

Hi all,

A quick query that I couldn't find any more documentation on:

Q: Am I right to assume under the msgbox return value of 1 (OK), nothing is necessary in order to proceed processing the script?

A: Nothing is necessary, no matter what the return value is. You, as programmer, have complete control what you do.

Under the return value of 2, I wish to cancel/exit the script, so I figured exit would do just nicely. However, I couldn't find out what to do for 1; is it bad scripting to leave it blank?

Select
    Case $iMsgBoxAnswer = 1

    Case $iMsgBoxAnswer = 2
        Exit
EndSelect

Many thanks for your time.

Either:

Select
    Case $iMsgBoxAnswer = 2
        Exit
EndSelect

Or just:

If $iMsgBoxAnswer = 2 Then Exit
Edited by Manadar

Share this post


Link to post
Share on other sites
Ozzzi

Thank you, Manadar.

That last option,

If $iMsgBoxAnswer = 2 Then Exit

..is appealing; simple is beautiful. I think I might utilise that.

Thank you again and thanks for such a well documented program, for a programmer, I am not.. :)

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.