Just_Plain_Cool Posted August 19, 2004 Share Posted August 19, 2004 Hello all... I have two scripts that use exactly the same code to confirm that a user wants to exit the script. In both cases, the code is called as a subroutine. In one script, the code works fine. In the other, AutoIt is reporting "ERROR: syntax error Func". I have even cut and pasted the code between the two scripts to no avail. Here is the code snippet. The first line is the Exit command from the main body of the script. It is called in multiple places in each script with "Confirm()". Exit Func Confirm() $Confirm = MsgBox(1, "Confirm", "Do you want to exit?") If $Confirm = 1 Then Exit Else EndIf EndFunc Any ideas??? I'm stumped... Thanks in advance, Just Plain Cool Link to comment Share on other sites More sharing options...
Andre Posted August 19, 2004 Share Posted August 19, 2004 Hi, Try this Exit Func Confirm() $Confirm = MsgBox(1, "Confirm", "Do you want to exit?") If $Confirm = 1 Then Exit EndIf EndFunc so without the else Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
Just_Plain_Cool Posted August 19, 2004 Author Share Posted August 19, 2004 Hi Andre, Hmmm...that "else" used to be there for a reason, I can't believe I didn't notice it was still there when I looked at this code. That being said, the error still exists after removing the "else". Any other takers? Thanks, Just Plain Cool Link to comment Share on other sites More sharing options...
Andre Posted August 19, 2004 Share Posted August 19, 2004 Hi, Strange thing. Are u using the v3.0.102 version ? And search in your script that fails for confirm ? Perhaps you have defind it double ? Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
Just_Plain_Cool Posted August 19, 2004 Author Share Posted August 19, 2004 Yes, I am using v3.0.102. And it is not in there twice. Hi, Strange thing. Are u using the v3.0.102 version ? And search in your script that fails for confirm ? Perhaps you have defind it double ? Andre <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
Andre Posted August 19, 2004 Share Posted August 19, 2004 could you please post the Full failing code ? Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
SlimShady Posted August 19, 2004 Share Posted August 19, 2004 could you please post the Full failing code ? Andre <{POST_SNAPBACK}>Yeah. Because the script you posted in your first post should work fine. Link to comment Share on other sites More sharing options...
Just_Plain_Cool Posted August 19, 2004 Author Share Posted August 19, 2004 I found the error! The error actually occurred MUCH earlier in the code. I had added an If statement and then somehow, I put an Exit instead of an EndIf. The error message is odd and misplaced, but at least the mystery is solved. Thanks for your help guys... Just Plain Cool Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now