Functions Documentation
View Function Edit Function
Name errBlock
Syntax (errBlock list exp1 ... expn expError)
Argument List list: A list of temporary variables. The first variable stores any error that happens
exp1 ... expn: The expressions you want to run.
expError: The expression you want to run if an error occurs.
Returns The result of the last expression
Category control structure, error
Description Allows you to run expressios one right after the other. If there is an error the error is stored in the error variable and then runs the last function. If no errors the last function isn't run.
(errblock (errVar)
(dbgOutput "Running normally")
(divide 10 0)
(dbgOutput "Not running normally")
(dbgOutput "The error is " errVar)

Running normally

The error is Division by zero (10 0) ### (divide 10 0) ###

Comment Like iserror not as useful as it could be due to many errors hard crash the game and you can't throw your own errors.