☜ | Error Processing1995 Version of ANSI (Equivalent to Current ISO Version) of Standard | ☞ |
Error trapping provides a mechanism by which a process can execute specifiable commands in the event that $ECode becomes non-empty. The following facilities are provided:
The $ETrap special variable may be set to either the empty string or to code to be invoked when $ECode becomes non-empty. Stacking of the contents of $ETrap is performed via the New command.
$ECode provides information describing existing error conditions. $ECode is a comma-surrounded list of conditions.
The $STack function and $STack variable provide stack related information.
$EStack counts stack levels since $EStack was last Newed.
An Error Processing transfer of control consists of an implicit Goto (without changing the PROCESS-STACK) to the following two lines of code where x is the value of $ETrap. These lines are implicitly incorporated into the current execution environment immediately preceding the next command in the normal execution sequence.
ls x eol
ls Quit:$Quit "" Quit eol
For purposes of this transfer each command argument is considered to have its own commandword (see 8.1 General command rules)
An Error Processing transfer of control is performed when:
When $STack($STack,"ECODE") returns a non-empty string and the value of $ECode changes to a non-empty string, the following actions are performed:
Copyright © Standard Documents; 1977-2024 MUMPS Development Committee;
Copyright © Examples: 1995-2024 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2024 Ed de Moel.
This page most recently updated on 17-Nov-2023, 10:36:48.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)