Jump to content

Losing It?


Recommended Posts

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 :ph34r:

Link to comment
Share on other sites

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

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

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