☜ | ssvnM[UMPS] by Example | ☞ |
Structured system variables (ssvn in metalanguage terminology) behave like global variables when used as parameters of the functions $DATA and $ORDER. When used in arguments of SET, MERGE and KILL commands, their behavior is different: either such usage is not allowed, but if it is allowed, there usually is a side-effect that is specific for the structured system variable in question.
In general, the structured system variables provide a directory for a specific aspect of the M[UMPS] language. In a number of cases, the structured system variables are used to manipulate ‘meta-information’ about the entities that are described in them.
Names of structured system variables may be returned by references to the function $QUERY. In such cases, a “canonic” form of the name will be returned, in which all parts that may be abbreviated are spelled out fully, and in which all parts that are case insensitive are spelled in upper case only.
Window Attributes
Gadget Attributes
Choice Attributes
Event Attributes
Event Information
Structured system variables can be referenced in many ways. A “normal” reference would look like
Set copy=^$name(1,"abc",3)
In the 1984 ANSI M[UMPS] language standard, the concept of “multi-level indirection”
was introduced. This way of referencing separates a “root”, which can be either just a name
or a name with one or more subscripts, from a list of subscripts, which means that the above
reference could be written in a number of different ways as well:
Set root="^$name",copy=@root@(1,"abc",3)
Set root="^$name(1)",copy=@root@("abc",3)
Set root="^$name(1,""abc"")",copy=@root@(3)
Set root="^$name(1,""abc"",3)",copy=@root
This feature also offers a simple mechanism to display a complete (sub)tree of a structured system variable:
Show(root) | Write:$Data(@root)#2 !,root," = ",@root Set sub="" For Set sub=$Order(@root@(sub)) Quit:sub="" Do Show($Name(@root@sub)) Quit |
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.
The information in this page is
NOT authoritative and subject to be modified
at any moment.
Please consult the
appropriate (draft) language standard for an
authoritative definition.
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 17-Nov-2023, 11:27:04.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)