$ECode
$ECode
$EC[ODE] contains a list of error codes for “active” errors -the error conditions which are not yet resolved. If there are no active errors, $ECODE contains the empty string. Whenever an error occurs, a code for that error is appended to the value of $ECODE in such a way that the value of $ECODE always starts and ends with a comma.
The value of $ECODE can be SET, and when it is set to a non-NULL value, error processing starts.
List of codes for $ECODE start with comma seperated by commas. A code starts with “M”, “U”, or “Z”, with rest numeric. “M” codes are assigned by MDC (MUMPS Development Committee), “U” by application (programmers), and “Z” codes by MUMPS implementors (in this case GT.M).
An error always has a GT.M specified code and many errors also have an ANSI Standard code. The complete list of standardized error codes can be referenced from GT.M Message and Recovery Procedures Reference Manual version 4.3 and onwards.
IF $ECODE[",M61," WRITE "Undefined local variable"$ECODE can be SET but not NEW’d. When $ECODE is set to the empty string (" “), error handling becomes “inactive” and therefore QUIT does not trigger additional error handling.
When $ECODE is not set to the empty string, M error handling is active, which also affects behavior in some aspects of $STACK.