Sign in to follow this  
Followers 0
hispeed_mike

MsgBox - on Button Click continue script

5 posts in this topic

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

Share this post


Link to post
Share on other sites



$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

Share this post


Link to post
Share on other sites

$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

Share this post


Link to post
Share on other sites

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

why? thats how return values work on any function, no need to say so for msgbox specifically

the 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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

With this remark:

Return Value

Success: 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 by SmOke_N

[center]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.[/center]

Share this post


Link to post
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
Sign in to follow this  
Followers 0