☜ | User-Defined mnemonicspacesDraft MDC Standard | ☞ |
When a controlmnemonic is used for a device which has a user-defined mnemonicspace (see 8.2.25) then the usage of the controlmnemonic in a Read and Write command format in the form
/controlmnemonic(expr,...)
is computationally equivalent, with the exception of the effect on $Test and the naked indicator, to
where routine is the user-defined mnemonicspace routine and label is controlmnemonic, unless controlmnemonic commences with a ? in which case it is replaced by %. If the controlmnemonics of the mnemonicspace are case-insensitive then label is controlmnemonic converted to upper-case. Unless specifically stated otherwise mnemonicspaces are case-sensitive.
$Test and the naked indicator are restored to their value prior to the execution of the controlmnemonic associated routine. $Test is not restored if there is a timeout on the original command.
Any reference to a controlmnemonic within a user-defined mnemonicspace for which there is no associated line causes an error condition with ecode = "M32".
devicecommand | ::= | │ │ │ │ |
Close OPEN USE |
│ │ │ │ |
If a label of the form %command, where command is a devicecommand, exists in a mnemonicspace command routine then execution of a command which is a devicecommand with at least one deviceparam is computationally equivalent to
New KEYWORD,ATTRIB,I
Set (KEYWORD,ATTRIB)=no
For I=1:1:no Do
. Set KEYWORD(I)=keyI
. If $Data(attI) Set ATTRIB(I)=attI
. Quit
Do %label^routine(expr,.KEYWORD,.ATTRIB,time)
where label is the commandword converted to upper-case and expanded to the fully spelled out devicecommand, routine is the user-defined mnemonicspace command routine, no is the number of deviceparams, KEYWORD and ATTRIB contain the individual deviceparams in deviceparameters fully evaluated with keyi=devicekeywordi or deviceattributei as appropriate and atti=expri if deviceparam is in the deviceattribute form, and time is absent or the evaluated expression from timeout if timeout is present.
The usage of the deviceparam form expr is implementation specific.
Any action implied by the presence of a mnemonicspace in such a command takes effect before the above code is executed.
iocommand | ::= | │ │ │ |
Read WRITE |
│ │ │ |
If a label of the form %command, where command is an iocommand, exists in a mnemonicspace command routine then execution of an iocommand of the form:
is respectively computationally equivalent, with the exception of the effect on $Test and the naked indicator, to:
where:
It is the responsibility of the user-defined mnemonicpace routine to process the deviceparameters in the appropriate order.
During the execution of any user-defined mnemonicspace command routine:
Upon completion of execution of the user-defined mnemonicspace routine, the naked indicator is restored to its original value.
In the event that a timeout is not present, $Test is also restored when execution of the routine completes. However, if a timeout is present, $Test is not restored and it is the responsibility of the user-defined mnemonicspace routine to return $Test to indicate whether the operation times out.
Note: $Storage may be affected by the execution of user-defined mnemonicspace code.
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 13-Sep-2014, 22:39:17.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)