Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples
Left Hand Pointer

$STORAGE

M[UMPS] by Example

Right Hand Pointer

Introduced in the 1977 ANSI M[UMPS] language standard

The value of this variable is an implementation-specific measure for the amount of storage that is available for the manipulation of local variables.

If $Storage<500 Write !,"Now",$Storage," left."

Assume that the following subroutine is available for execution:

X Write !,"Before NEW command: ",$Storage
 New A,B,C
 Write !,"After NEW command:  ",$Storage
 Set A=1,B=2,C=3
 Write !,"After SET command:  ",$Storage
 Set LEVEL=LEVEL+1
 If LEVEL<6 Do X
 Quit

Then, the commands
Set LEVEL=0 Write "Start: ",$Storage Do X
will produce (note that these changes are implementation-specific):

Start: 153536
Before NEW command: 153456                        Change is 80
After NEW command:  153360                        Change is 96
After SET command:  153168                       Change is 192
Before NEW command: 153168                         Change is 0
After NEW command:  153120                        Change is 48
After SET command:  152928                       Change is 192
Before NEW command: 152928                         Change is 0
After NEW command:  152880                        Change is 48
After SET command:  152688                       Change is 192
Before NEW command: 152688                         Change is 0
After NEW command:  152640                        Change is 48
After SET command:  152448                       Change is 192
Before NEW command: 152448                         Change is 0
After NEW command:  152400                        Change is 48
After SET command:  152208                       Change is 192
Before NEW command: 152208                         Change is 0
After NEW command:  152160                        Change is 48
After SET command:  151968                       Change is 192

Keep in mind that every New command creates a new environment for one or more variables. Although the old environment for those variables may be temporarily hidden, that environment still consumes space in the memory allocated to local variable storage.

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-2017 MUMPS Development Committee;
Copyright © Examples: 1995-2017 Ed de Moel;
Copyright © Annotations: 2003-2017 Jacquard Systems Research.

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 13-Sep-2014, 14:44:02 .

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