Sign in to follow this  
Followers 0
Ozzzi

MsgBox and Select case expression

3 posts in this topic

#1 ·  Posted (edited)

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



#2 ·  Posted (edited)

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

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  
Followers 0