Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

Error Handling System Variables


The following system variables are either set by IDL when an error condition occurs or used by IDL when displaying information about errors.

!ERR

This system variable is now obsolete and has been replaced by the !ERROR_STATE system variable. Code that uses the !ERR system variable will continue to function as before, but all new code should use !ERROR_STATE.CODE.

!ERROR_STATE

A structure variable which contains the status of the last error message. !ERROR_STATE includes the following fields:

** Structure !ERROR_STATE, 8 tags, length=112, data length=108: 
   NAME            STRING    'IDL_M_SUCCESS' 
   BLOCK           STRING    'IDL_MBLK_CORE' 
   CODE            LONG                    0 
   SYS_CODE        LONG      Array[2] 
   SYS_CODE_TYPE   STRING    '' 
   MSG             STRING    '' 
   SYS_MSG         STRING    '' 
   MSG_PREFIX      STRING    '% ' 

This system variable replaces !ERROR, !ERR_STRING, !MSG_PREFIX, !SYSERR_STRING, and !SYSERROR, and includes two new fields: error name and block name. For a more detailed explanation of !ERROR_STATE, see Error Handling.

!ERROR

This system variable is now obsolete and has been replaced by the !ERROR_STATE system variable. Code that uses the !ERROR system variable will continue to function as before, but we suggest that all new code use !ERROR_STATE.CODE.

!ERR_STRING

This system variable is now obsolete and has been replaced by the !ERROR_STATE system variable. Code that uses the !ERR_STRING system variable will continue to function as before, but we suggest that all new code use !ERROR_STATE.MSG.

!EXCEPT

An integer variable that controls when IDL checks for invalid mathematical computations (exceptions), such as division by zero. The three allowed values are:

Value
Description
0
Never report exceptions.
1
Report exceptions when the interpreter is returning to an interactive prompt (the default).
2
Report exceptions at the end of each IDL statement. Note that this slows IDL by roughly 5% compared to setting !EXCEPT=1.

For more information on invalid mathematical computations and error reporting, see Math Errors.

The value of !EXCEPT is used by the CHECK_MATH function to determine when to return errors. See CHECK_MATH for details.

Note
In versions of IDL up to and including IDL 4.0.1, the default exception handling was functionally identical to setting !EXCEPT=2.

!MOUSE

A structure variable that contains the status from the last cursor read operation. !MOUSE has the following fields:

** Structure !MOUSE, 4 tags, length=16: 
   X               LONG               511 
   Y               LONG               252 
   BUTTON          LONG                 4 
   TIME            LONG        1428829775 

See CURSOR for details on reading the cursor position.

!MSG_PREFIX

This keyword is now obsolete and has been replaced by the !ERROR_STATE system variable. Code that uses the !MSG_PREFIX system variable will continue to function as before, but we suggest that all new code use !ERROR_STATE.MSG_PREFIX.

!SYSERROR

This keyword is now obsolete and has been replaced by the !ERROR_STATE system variable. Code that uses the !SYSERROR system variable will continue to function as before, but we suggest that all new code use !ERROR_STATE.SYS_CODE.

!SYSERR_STRING

This keyword is now obsolete and has been replaced by the !ERROR_STATE system variable. Code that uses the !SYSERR_STRING system variable will continue to function as before, but we suggest that all new code use !ERROR_S class="cItalic">TATE.SYS_MSG.

!WARN

A structure variable that causes IDL to print warnings to the console or command log when obsolete IDL features are found at compile time. !WARN has the following fields:

** Structure !WARN, 3 tags, length=3: 
   OBS_ROUTINES         BYTE         0 
   OBS_SYSVARS          BYTE         0 
   PARENS               BYTE         0 

Setting each of the three fields to 1 (one) generates a warning for a different type of obsolete code. If the OBS_ROUTINES field is set equal to one, IDL generates warnings when it encounters references to obsolete internal or library routines. If the OBS_SYSVARS field is set equal to one, IDL generates warnings when it encounters references to obsolete system variables. If the PARENS field is set equal to one, IDL generates warnings when it encounters a use of parentheses to specify an index into an array. No warnings are generated when the fields of the !WARN structure are set equal to zero (the default).


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]