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

^$Y*

Draft MDC Standard

7.1.3.10 ^$Y[unspecified]

These ssvns are reserved for users and are called user-defined structured system variables. The syntax is

^ $ Y name [ ( L expr ) ]

An implementation is required to provide a means of associating a routine with one or more specific user-defined structured system variables.

This routine is called whenever a reference is made to a user-defined structured system variable by calling one of the following labels in the routine with first the parameter being the value of $NAme of the reference and the second parameter, if any, as below:

Reference Type Label Second Parameter Result
Evaluation %VALUE Yes
$Data parameter %DATA Yes
$Get parameter %GET Second parameter of $Get Yes
$Order paramater %ORDER Second parameter of $Order Yes
$Query parameter %QUERY Second parameter of $Query Yes
Kill command %KILL No
KSubscripts command %KSUBSCRIPTS No
KValue command %KVALUE No
Merge command target %MERGE Source glvn No
Merge command source %MERGES Target glvn No
Value assignment %SET Value to be assigned No

The usage of $Order and $Query with unsubscripted user-defined system variables has the same effect as if they were not user defined.

Editor’s note:
This seems erroneous to me: $Query of an unsubscripted reference is no differrent from $Query of a subscripted reference, it just should return the namevalue of the first data node.
I think it should not be labeled as an exception here.
$Order of an unsubscripted reference is not defined in this standard.

If both the source and target of a Merge command are user-defined structured system variables, then only the Merge label for the target ssvn is called.

Let r be the name of the routine being called when a reference is made to a certain user-defined structured system variable, and let l be the label at which this routine is called. If the routine does not exist when a reference is made to the user-defined structured system variable, then an error condition occurs with ecode = M97. If the routine exists, but the label does not exist when a reference is made to the user-defined structured system variable, then an error condition occurs with ecode = M13.

Note: names of user-defined structured system variables which differ only in the use of corresponding upper and lower case letters are not equivalent.

Note: Users providing routines to implement user-defined structured system variables are responsible for ensuring that other side-effects (such as a change to $Test or $Data values), which would not have taken place, had the reference been to a global variable, do not occur as a result of calling the routine.

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, 12:06:44.

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