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

gvn

Draft MDC Standard

7.1.2.4 Global variable name gvn

    gvn::=

rgvn
@ expratom V gvn


    rgvn::=


^ ( L expr )
^ [ VB environment VB ] name [ ( L expr ) ]
@ gnamind @ ( L expr )



    gnamind::= rexpratom V gvn
    environment::= expr

The prefix ^ uniquely denotes a global variable name. A global variable name is either unsubscripted or subscripted; if it is subscripted, any number of subscripts separated by commas is permitted. Except where otherwise specified, a subscript may not equal the empty string. An abbreviated form of subscripted gvn is permitted, called the naked reference, in which the prefix is present but the environment, name and an initial (possibly empty) sequence of subscripts is absent but implied by the value of the naked indicator. An unsubscripted occurrence of gvn may carry a different value from any subscripted occurrence of gvn.

When environment is present it identifies a specific set of all possible names.

When gnamind is present it is always a component of an rgvn. If the value of the rgvn is a subscripted form of gvn, then some of its subscripts may have originated in the gnamind. In this case, the subscripts contributed by the gnamind appear as the first subscripts in the value of the resulting rgvn, separated by a comma from the (non-empty) list of subscripts appearing in the rest of the rgvn.

Every executed occurrence of gvn affects the naked indicator as follows. If, for any positive integer m, the gvn has the non-naked form

   N(v1 , v2 , ... , vm )

then the m-tuple N, v1 , v2 , ... , vm–1 , is placed into the naked indicator when the gvn reference is made. A subsequent naked reference of the form

   ^(s1 , s2 , ... , si )      (i positive)

results in a global reference of the form

   N(v1 , v2 , ... , vm–1 , s1 , s2 , ... , si )

after which the m+i–1-tuple N , v1 , v2 , ... , si–1 is placed into the naked indicator. Prior to the first executed occurrence of a non-naked form of gvn, the value of the naked indicator is undefined. A non-naked reference without subscripts or a ROLLBACK, or a change of the default global variable environment leaves the naked indicator undefined. When a gvn is encountered in the form of a naked reference and the naked indicator is undefined, an error condition occurs with ecode = "M1".

The effect on the naked indicator described above occurs regardless of the context in which gvn is found; in particular, an assignment of a value to a global variable with the command Set gvn = expr does not affect the value of the naked indicator until after the right-side expr has been evaluated. The effect on the naked indicator of any gvn within the right-side expr will precede the effect on the naked indicator of the left-side gvn.

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 17-Nov-2023, 11:24:33.

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