Jump to content
Sign in to follow this  
Paradigm

Msg box return issue

Recommended Posts

I just started with AutoIt and I've searched the forums/helpfiles but I can't seem to fin the answer to this simple question... It's probably fight under my nose and I can't see the forest for the trees... :">

Here's my script (it's very simple):

MsgBox( 4, "What should I open?", "'Yes' opens notepad and 'no' opens media player")

If Return = 6 Then
Run("notepad.exe")

ElseIf Return = 7 Then
Run("wmplayer.exe")

EndIf

I get the error:

If Return = 6 Then
If ^ ERROR
Error: Error in exp[b][/b]ression.

If I take out the "Return =", both buttons execute notepad.

I know it has to be something obvious... I just can't see it. (prolly thinking too hard...)

Edited by Paradigm

Share this post


Link to post
Share on other sites

$rc = MsgBox( 4, "What should I open?", "'Yes' opens notepad and 'no' opens media player")

If $Rc= 6 Then
    Run("notepad.exe")
ElseIf $rc = 7 Then
    Run("wmediaplayer.exe")
Else 
    ; something else was clicked
EndIf

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  

×
×
  • Create New...