hispeed_mike Posted November 24, 2006 Share Posted November 24, 2006 Hi all, Just starting to use return values from Button clicks. My question is how would I write a script that on click of OK on a msgbox would continue a script or cancel would stop the script. Here is what I have got to, but don't know the command to wait for the return value and continue. MsgBox(1, "Start Client Setup", "Click OK when ready to Continue...") If ; OK clicked then :Rest of Script Else ; Cancel Pressed and stop script EndIf Appreciate the heads up on this... Mike Link to comment Share on other sites More sharing options...
theguy0000 Posted November 24, 2006 Share Posted November 24, 2006 $msgbox = MsgBox(1, "Start Client Setup", "Click OK when ready to Continue...") If $msgbox = 2 Then ;cancel pressed, stop script Else ;OK clicked ;rest of script EndIf directly from the help file, look at "Return values" OK - 1 Cancel - 2 Abort - 3 Retry - 4 Ignore - 5 Yes - 6 No - 7 Try Again - 10 Continue - 11 "Try Again" and "Continue" only work on Windows 2000/XP and above The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
hispeed_mike Posted November 24, 2006 Author Share Posted November 24, 2006 $msgbox = MsgBox(1, "Start Client Setup", "Click OK when ready to Continue...") If $msgbox = 2 Then ;cancel pressed, stop script Else ;OK clicked ;rest of script EndIf directly from the help file, look at "Return values" OK - 1 Cancel - 2 Abort - 3 Retry - 4 Ignore - 5 Yes - 6 No - 7 Try Again - 10 Continue - 11 "Try Again" and "Continue" only work on Windows 2000/XP and above Thanks for that. $msgbox is the tip I was looking for. Help file outlines the return values. Perhaps as a tip for the section on the MsgBox command it should also reference the $msgbox. Thanks for that. Mike Link to comment Share on other sites More sharing options...
theguy0000 Posted November 24, 2006 Share Posted November 24, 2006 Thanks for that. $msgbox is the tip I was looking for. Help file outlines the return values. Perhaps as a tip for the section on the MsgBox command it should also reference the $msgbox.Thanks for that.Mikewhy? thats how return values work on any function, no need to say so for msgbox specificallythe only reason it was unclear was because you did not know how to retrieve return values....although, I do agree that it could be included in an example at least... The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 24, 2006 Moderators Share Posted November 24, 2006 (edited) With this remark:Return ValueSuccess: Returns the ID of the button pressed.It's implied. No need for 40 different examples to show how to use all the options. Edited November 24, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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