polara Posted July 5, 2006 Share Posted July 5, 2006 How can I get a script to stop running and exit if Cancel is clicked in a Message Box? Link to comment Share on other sites More sharing options...
eynstyne Posted July 5, 2006 Share Posted July 5, 2006 (edited) 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 exitendif Edited July 5, 2006 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 More sharing options...
polara Posted July 5, 2006 Author Share Posted July 5, 2006 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 exitendifWell, 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 More sharing options...
Moderators big_daddy Posted July 5, 2006 Moderators Share Posted July 5, 2006 $MsgBox = MsgBox(1, "Test for ok or cancel", "Click OK to continue. Click Cancel to stop this script.") If $MsgBox = 1 Then MsgBox(0, "", "You must have clicked Ok.") Else MsgBox(0, "", "You must have clicked Cancel. Bye Bye!") EndIf Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 5, 2006 Share Posted July 5, 2006 (edited) 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 July 5, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now