on_error()

Sets the AEL function to be called in case of an error. If the argument is omitted or is NULL, then the current error handler is removed. The address of the old error handler function is returned. If the argument is not an AEL function address, the function fails and reports an error.

When an error occurs, the error handler function is called and passes the following:

The error handling function should return a value of NULL to ignore the error (after taking appropriate corrective action) or a non-zero integer value to allow AEL to continue error processing. Returns a function address.

See also: error().

Syntax:

on_error( [func] );

where

func is the address of error handling function.

Example:
defun report_error( code, class, op, line, col)
{
      fputs( stderr, strcat("Error occurred:", class, code, " at ", line, "/", col));
      return TRUE;
}
on_error( report_error);
Common Run Time Error Codes
Code Definition
300 Integer parameter value was required
301 Real parameter value was required
302 Two numeric parameters are required
303 String parameter value was required
304 Incorrect type of parameter value
305 Parameters cannot be matched
306 Stack reference to value not on stack
307 Wrong number of parameters passed
308 Numeric parameter expected
309 Function address missing for call
310 Function address not executable
311 Word reference parameter expected
312 Bad frame reference */
313 Integer divide by zero
314 Real divide by zero
315 Complex divide by zero
316 Illegal return value from compare function
317 Values not comparable
318 Log of negative number
319 Log of zero
320 Square root of negative number
AEL Operation Codes
Code Definition Code Definition
0 discard return value 16 assign
1 logical OR 17 dereference word
2 logical AND 18 call function
3 logical NOT 19 call function, discard return value
4 logical test == 20 return from function
5 logical test != 21 branch on TRUE
6 logical test >= 25 bitwise AND
7 logical test <= 26 bitwise exclusive OR
8 logical test > 27 bitwise OR
9 logical test < 28 bitwise ones compliment
10 add 29 bitwise left shift
11 subtract 30 bitwise right shift
12 multiply 31 pre-increment
13 modulus divide 32 pre-decrement
14 divide 33 post-increment
15 negate 34 post-decrement

Where Used:

Measurement Expressions (Data Display equations and Schematic MeasEqns), Schematic, Layout, Simulation, GUI

 

Privacy Statement  | Terms of Use  | Legal | Contact Us  | © Agilent 2000-2008 

Contents
Additional Resources