Reloaded Posted February 10, 2010 Posted February 10, 2010 Ok so i have this MsgBox MsgBox(1, "Title", "Label") How can i find out if OK or CANCEL was pressed that way i can stop and exit the loop or script when CANCEL is pressed.
bogQ Posted February 10, 2010 Posted February 10, 2010 (edited) put variable infront msgbox an doIf $var = 1 then..from help fileReturn ValueSuccess: Returns the ID of the button pressed. Failure: Returns -1 if the message box timed out.Button Pressed Return Value OK 1 CANCEL 2 ABORT 3 RETRY 4 IGNORE 5 YES 6 NO 7 TRY AGAIN ** 10 CONTINUE ** 11 Edited February 10, 2010 by bogQ oskrki 1 TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
ds34 Posted February 10, 2010 Posted February 10, 2010 $answer=MsgBox(1,"A","B") Now $answer has the button ID, check helpfile for Msgbox: Button Pressed Return Value OK 1 CANCEL 2 ABORT 3 RETRY 4 IGNORE 5 YES 6 NO 7 TRY AGAIN ** 10 CONTINUE ** 11
Reloaded Posted February 10, 2010 Author Posted February 10, 2010 put variable infront msgbox an do If $var = 1 then.. from help file Ok thanks that worked! Now here is what i have so far and if the button NO is pressed how can i stop the program from being exited because ExitLoop and Exit just closes the program. $msgBox = MsgBox(4, "Title", "Label") ; i decided to change to a YES and NO so NO's ID = 7 If $msgBox = 7 Then Exit ; how can i break out of this IF statement without closing the whole program? Else xfSkinVista() EndIf
99ojo Posted February 10, 2010 Posted February 10, 2010 Hi, just change your logic: $msgBox = MsgBox(4, "Title", "Label") ; i decided to change to a YES and NO so NO's ID = 7 and YES = 6 If $msgBox = 6 Then xfSkinVista() EndIf ;go on with further coding ;-)) Stefan
Reloaded Posted February 10, 2010 Author Posted February 10, 2010 Hi, just change your logic: $msgBox = MsgBox(4, "Title", "Label") ; i decided to change to a YES and NO so NO's ID = 7 and YES = 6 If $msgBox = 6 Then xfSkinVista() EndIf ;go on with further coding ;-)) Stefan Ooooh good idea
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