Jump to content

Exit script if Cancel


Recommended Posts

In the help file, look up msgbox. There is a list of number codes used for the cancel, abort, retry etc. buttons.

$msg = messagebox(64;<-- icon, but can also be the cancel, abort, retry buttons, "Title","Body")

if $msg = 2(Cancel) then

exit

endif

Edited by eynstyne
F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]
Link to comment
Share on other sites

In the help file, look up msgbox. There is a list of number codes used for the cancel, abort, retry etc. buttons.

$msg = messagebox(64;<-- icon, but can also be the cancel, abort, retry buttons, "Title","Body")

if $msg = 2(Cancel) then

exit

endif

Well, I did consult the Help file but couldn't figure out how to proceed. That's why the post. What I am trying to make happen is this:

MsgBox(1, "Test for ok or cancel", "Click OK to continue. Click Cancel to stop this script.")

If Ok was clicked I want to get this:

MsgBox(0,"You must have clicked Ok.")

If Cancel was clicked I want to get this:

MsgBox(0,"You must have clicked Cancel. Bye Bye!")

Thanks.

Link to comment
Share on other sites

HI,

look into help. It must be there :-)

$var = MsgBox(1, "Test for ok or cancel", "Click OK to continue. Click Cancel to stop this script.")

If $var = 1 Then
    MsgBox(0, "info", "You must have clicked Ok.")
Else
    MsgBox(0, "info", "You must have clicked Cancel. Bye Bye!")
EndIf

Edit: a bit late. Damn! :-)

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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