Sign in to follow this  
Followers 0
Paradigm

Msg box return issue

3 posts in this topic

#1 ·  Posted (edited)

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thanks!

I knew it had to be something absurdly simple... what a way to enter the forums... :D

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