Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

$STACK

Draft MDC Standard

7.1.5.23 $STack

$ST[ACK] ( intexpr )

This form returns a string as follows:

  1. If intexpr is –1:
    1. If $ECode is not empty, returns the highest value where $STack( intexpr ) can return non-empty results.
    2. If $ECode is empty then return $STack.
  2. If intexpr is 0 (zero), returns an implementation specific value indicating how this process was started.
  3. If intexpr is greater than 0 (zero) and less than or equal to $STack indicates how this level of the PROCESS-STACK was created:
    1. If due to a command, the commandword, fully spelled out and in uppercase.
    2. if due to an exfunc or exvar, the string "$$".
    3. if due to an error, the ecode representing the error that created the result returned by $STackintexpr ).
  4. If intexpr is greater than $STack, returns an empty string.
  5. Values of intexpr less than –1 are reserved for future extensions to the $STack function.

$ST[ACK] ( intexpr , stackcodexpr )

    stackcodexpr::= expr V stackcode
    stackcode::=


"PLACE"
"MCODE"
"ECODE"



This form returns information about the action that created the level of the PROCESS-STACK identified by intexpr as follows:

  1. Values of intexpr < 0 are reserved.
  2. Values of intexpr > $STack return the empty string.
stackcode Returned String
ECODE the list of any ecodes added at the level of the PROCESS-STACK identified by intexpr.
MCODE the value (in the case of an Xecute) or the line for the location identified by $STackintexpr , "PLACE" ). If the line is not available, an empty string is returned.
PLACE the location of a command at the intexpr level of the PROCESS-STACK as follows:
  1. if intexpr is not equal to $STack and $STack( intexpr , "ECODE" ) would return the empty string, the last command executed.
  2. if intexpr is equal to $STack and $STack( intexpr , "ECODE" ) would return the empty string, the currently executing command.
  3. if $STack( intexpr , "ECODE" ) would return a non-empty string, the last command to start execution while $STack( intexpr , "ECODE" ) would have returned the empty string.

The location is in the form:

   place SP + eoffset

    place::=

[ label ] [ + intlit [ ^ VB environment VB routinename
@


    eoffset::= intlit

In place, the first case is used to identify the line being executed at the time of creation of this level of the PROCESS-STACK. The second case (@) shows the point of execution occurring in an Xecute.

eoffset is an offset into the code or data identified by place at which the error occurred. The value might point to the first or last character of a "token" just before or just after a "token", or even to the command or line in which the error occurred. Implementors should provide as accurate a value for eoffset as practical.

All values of stackcode beginning with the letter Z are reserved for the implementation. All other values of stackcode are reserved for future extensions to the $STack function. stackcodes differing only in the use of corresponding upper and lower case letters are equivalent.

Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples

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.

Some specifications are "approved for inclusion in a future standard". Note that the MUMPS Development Committee cannot guarantee that such future standards will indeed be published.

This page most recently updated on 15-Nov-2023, 13:13:25.

For comments, contact Ed de Moel (demoel@jacquardsystems.com)