Sign in to follow this  
Followers 0
MaCgyver

msgbox and user response

6 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Thanks for the code example JosBe, I read thru that section of the help file but it didn't click with me to set the msgbox as a variable. I love reading thru these posts, I am learning so much about AutoIT.

Share this post


Link to post
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.


[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

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.

Share this post


Link to post
Share on other sites

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


[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