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

Variables

Draft MDC Standard

7.1.1.2 Variables

The M[UMPS] standard uses the terms local variables and global variables somewhat differently from their connotation in certain other computer languages. This subclause provides a definition of these terms as used in the M[UMPS] environment.

A M[UMPS] routine, or set of routines, runs in the context of an operating system process. During its execution, the routine will create and modify variables that are restricted to its process. These process-specific variables may be stored in primary memory or on secondary peripheral devices such as disks. It can also access (or create) variables that can be shared with other processes. These shared variables will normally be stored on secondary peripheral devices such as disks. At the termination of the process, the process-specific variables cease to exist. The variables created for long term (shared) use remain on auxiliary storage devices where they may be accessed by subsequent processes.

M[UMPS] uses the term local variable to denote variables that are created for use during a single process activation. These variables are not available to other processes. However, they are generally available to all routines executed within the process’s lifetime. M[UMPS] does include certain constructs, the New command and parameter passing, which limit the availability of certain variables to specific routines or parts of routines.

A global variable is one that is created by a process, but is permanent and shared. As soon as a process creates, modifies or deletes a global variable outside of a TRANSACTION, other processes accessing that global variable outside of a TRANSACTION receive its modified form. (See 6.3.1 Transaction processing for a definition of TRANSACTION and information on how TRANSACTIONs affect global variable modifications.) Global variables do not disappear when a process terminates. Like local variables, global variables are available to all routines executed within a process.

M[UMPS] has no explicit declaration or definition statements. Local and global variables, both non-subscripted and subscripted, are automatically created as data is stored into them, and their data contents can be referred to once information has been stored. Since most operations in the language create values of only one data type - string - there is no need for type declarations or explicit data type conversions. Array structures can be multidimensional with data simultaneously stored at all levels including the variable name level. Subscripts can be positive, negative, or zero; they can be integer or non-integer numbers as well as non-numeric strings (other than empty strings).

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, 09:48:43.

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