User Tools

Site Tools


modding:function:errblock

errblock

errblock

errblock

Syntax (errblock List function1 function)
Arguments List: A list of temporary variables. The first variable gets any error stored in it that happens.
function: The functions you want to run.
1
function: The function you want to run if there is an error in the other functions.
Returns Whatever the last function or primitive that runs in it returns.
Category control structure, error
Description Allows you to run functions 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.

Example

(errblock (errVar)
	(dbgOutput "Running normally")
	(divide 10 0)
	(dbgOutput "Not running normally")
 
	(dbgOutput "The error is " errVar)
	)

Displays Running normally The error is Division by zero (10 0) ### (divide 10 0) ### True Return to Functions list

modding/function/errblock.txt · Last modified: 2014/12/27 04:40 by 127.0.0.1