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

User-Defined mnemonicspaces

Draft MDC Standard

8.1.9 User-defined mnemonicspaces

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

   Do label^routine(expr,...)

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:

  1. W[RITE] ffformat
  2. W[RITE] nlformat
  3. W[RITE] tabformat
  4. W[RITE] expr
  5. W[RITE] * intexpr
  6. R[EAD] glvn [ readcount ] [ timeout ]
  7. R[EAD] ffformat
  8. R[EAD] nlformat
  9. R[EAD] tabformat
  10. R[EAD] strlit
  11. R[EAD] * glvn [ timeout ]

is respectively computationally equivalent, with the exception of the effect on $Test and the naked indicator, to:

  1. Do %WriteFF^routine()
  2. Do %WriteNL^routine()
  3. Do %WriteTAB^routine( intexpr )
  4. Do %Write^routine( expr )
  5. Do %WriteS^routine( intexpr )
  6. Set glvn=$$%READ^routine( intexpr1 [ , intexpr2 ] )
  7. Do %WriteFF^routine(1)
  8. Do %WriteNL^routine(1)
  9. Do %WriteTAB^routine( intexpr ,1)
  10. Do %Write^routine( strlit ,1)
  11. Set glvn=$$%READS^routine( [ , intexpr2 ] )

where:

  1. routine is the user-defined mnemonicspace command routine,
  2. intexpr1 is the intexpr from readcount, or absent if no readcount is present, and
  3. if timeout is present, intexpr2 is the intexpr from timeout.

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:

  1. Read and Write redirection for the device that caused the routine to be executed is disabled; and
  2. the effect of user-defined processing of controlmnemonics and commands for the same mnemonicspace is unspecified.

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.

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 13-Sep-2014, 22:39:17.

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