Jump to content

Test Yes/no Return On Msgbox()


Recommended Posts

I know what the yes and no options return for the msgbox() function(6 and 7 respectively), but I am not sure how to test and figure out which one returned. I ran the autoit123 and also looked in help, but I can't find it. Help anyone? I know it has to be simple like if $?=6 then do something, but I can't seem to figure it out.

Link to comment
Share on other sites

I know what the yes and no options return for the msgbox() function(6 and 7 respectively), but I am not sure how to test and figure out which one returned. I ran the autoit123 and also looked in help, but I can't find it. Help anyone? I know it has to be simple like if $?=6 then do something, but I can't seem to figure it out.

no problem, welcome to the forum. assign the msgbox call to a variable, the value returned will be stored in the variable...

ex:

$blah = msgbox(4,"blah","pick yes or no")
if $blah = 6 then 
msgbox(0,"you picked","you clicked yes")
else
msgbox(0,"you picked","you clicked no")
EndIf
Link to comment
Share on other sites

no problem, welcome to the forum. assign the msgbox call to a variable, the value returned will be stored in the variable...

ex:

$blah = msgbox(4,"blah","pick yes or no")
if $blah = 6 then 
msgbox(0,"you picked","you clicked yes")
else
msgbox(0,"you picked","you clicked no")
EndIf
excellent! That is what I needed. Thanks for the quick responses guys.
Link to comment
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
 Share

  • Recently Browsing   0 members

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