Approved for inclusion in a future ANSI 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,.
This document is © Ed de Moel, 1995-2005.
It is part of a book by Ed de Moel that is published under
the title "M[UMPS] by Example" (ISBN 0-918118-42-5).
Printed copies of the book are no longer available.
This document describes the various commands that are defined in the M[UMPS] language standard (ANSI X11.1, ISO 11756).
The information in this document is NOT authoritative
and subject to be modified at any moment.
Please consult the appropriate (draft) language standard for an
authoritative definition.
In this document, information is included that will
appear in
future standards.
The MDC cannot guarantee that these 'next'
standards will indeed appear.