Jump to content

MsgBox and Select case expression


Ozzzi
 Share

Recommended Posts

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

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
Link to comment
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.. :)

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