Jump to content

Recommended Posts

Posted

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

Posted

$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

Posted

$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

Posted

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

  • Moderators
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

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...