Jump to content

Recommended Posts

Posted
;) Some programming languages allow that if it defines an error routine that always will be executed when some error to occur in the execution of the program. The AUTOIT has this resource?
Posted

one direction is "SetError "

$result = myDiv(5, 0)
If @error Then
    MsgBox(4096,"Error", "Division by Zero")
Else
    MsgBox(4096, "Result", $result)
EndIf
Exit

the other is "RunErrorsFatal"

Sets if the script should terminate with a fatal error if a Run/RunWait function fails due to bad paths/file not found/Bad login IDs:

1 = fatal error (default)

0 = silent error (@error set to 1)

you can find both of these in help

8)

NEWHeader1.png

Posted

one direction is "SetError "

$result = myDiv(5, 0)
If @error Then
    MsgBox(4096,"Error", "Division by Zero")
Else
    MsgBox(4096, "Result", $result)
EndIf
Exit

the other is "RunErrorsFatal"

Sets if the script should terminate with a fatal error if a Run/RunWait function fails due to bad paths/file not found/Bad login IDs:

1 = fatal error (default)

0 = silent error (@error set to 1)

you can find both of these in help

No.  Necessary of something thus: 

Start program

-----------------------------------------------------

If error go to treatment of error

-----------------------------------------------------

.

.

Program

.

.

Exit

----------------------------------------------------

Treatment of error

----------------------------------------------------

.

.

Program of treatment of error

.

.

Return

----------------------------------------------------

8)

<{POST_SNAPBACK}>

Posted

opt("runErrorsFatal", 0)

run("myProgram.exe")
if (@error) then handleLaunchError()
···
···
···

func handleLaunchError()
    ···
    ···
    ···
endFunc

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...