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

RSAVE

M[UMPS] by Example

Approved for inclusion in a future M[UMPS] language standard.

This command copies parts of a routine from a local or global variable into the implementation specific internal storage from which routines are executed. Typical practice is that this command creates new routines, or updates the executable version of a routine after its M[UMPS] code has been modified while temporarily stored in a local or global variable.

Any keywords in the argument of the command are processed in strict left-to-right order. When multiple equivalent parameters are encountered, the last occurrence processed will define the action(s) to be taken.

If the name of the routine in the argument of the RSave command is equal to the name of the routine executing the command in question, an error will occur (M25), and the internally stored routine will not be modified.

Assume that the array EDIT is populated as in the final example of the RLoad command, then the command RSave DEMO:EDIT will create a new version of the routine DEMO with the following content:

DEMO ; This is an example
 Write !,"This is the second line"
 Write !,"Last line with WRITE command"
 ;This stays as well
 Quit
 ;The final word

It is expected that the various nodes in the array EDIT contain valid M[UMPS] code. If the array contains invalid data, the standard does not (yet) specify any particular behaviour.

Examples with naked references:

RSave ROUTINE:VARIABLE
Set ^ABC(1,2)="reset naked indicator"
; naked indicator is now ^ABC(1,
RSave NAME:^(3,4)

; Copy code from ^ABC(1,3,4)
; naked indicator is now: ^ABC(1,3,
; Actual reference is: ^ABC(1,3,4)

Note: the code will be fetched from ^ABC(1,3,4,1), ^ABC(1,3,4,2) etcetera, but the naked indicator will remain ^ABC(1,3,.

RSave ROUTINE:VARIABLE:PARAMETERS
Set ^ABC(1,2)="reset naked indicator"
; naked indicator is now ^ABC(1,
RLoad NAME:^(3,4):(KEY1=^(5,6):KEY2=^(7,8))

; Fetch the value for the first parameter from ^(5,6) = ^ABC(1,5,6)
; naked indicator is now: ^ABC(1,5,
; Fetch the value from ^(7,8) = ^ABC(1,5,7,8)
; naked indicator is now: ^ABC(1,5,7,
; Copy code from ^(3,4) = ^ABC(1,5,7,3,4)
Note: the code will be fetched from ^ABC(1,5,7,3,4,1), ^ABC(1,5,7,3,4,2) etcetera, but the naked indicator will remain ^ABC(1,5,7,3,.

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.

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 15-Nov-2023, 18:55:20.

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