Jump to content

msgbox and user response


 Share

Recommended Posts

I am a newbie, but I've been learning.

I want the user to either click the yes or no in the message box and a particular result happens depending on what they click. I was looking up return, but I'm not sure if that is the right area to be in.

Link to comment
Share on other sites

I am a newbie, but I've been learning.

I want the user to either click the yes or no in the message box and a particular result happens depending on what they click. I was looking up return, but I'm not sure if that is the right area to be in.

$sAnswer = MsgBox( 4 , "Question", "Yes or Not?")
IF $sAnswer = 6 Then
    MsgBox(0, "", "You click 'YES'")
Else
    MsgBox(0, "", "You click 'NO'") 
EndIf

Read in the help about the flags -> Msgbox

Edited by Josbe
Link to comment
Share on other sites

  • Moderators

You don't have to use a variable in this case, but most do.

IF MsgBox( 4 , "Question", "Yes or Not?") = 6 Then
    MsgBox(0, "", "You click 'YES'")
Else
    MsgBox(0, "", "You click 'NO'") 
EndIf
Just thought I'd throw that in there, since you said you were 'learning so much' a bit more food for thought for ya.

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

You don't have to use a variable in this case, but most do.

IF MsgBox( 4 , "Question", "Yes or Not?") = 6 Then
    MsgBox(0, "", "You click 'YES'")
Else
    MsgBox(0, "", "You click 'NO'") 
EndIf
Just thought I'd throw that in there, since you said you were 'learning so much' a bit more food for thought for ya.

Thanks a million.

Link to comment
Share on other sites

  • Moderators

Hmmm, you should truly be thanking Josbe, I was just adding a little something in there. But, your quite welcome all the same.

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

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...