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

OPEN

Draft MDC Standard

8.2.25 Open

O[PEN] postcond SP L openargument

    openargument::=

devn [ : openparameters ]
@ expratom V L openargument


    openparameters::=


deviceparameters [ timeout [ : mnemonicspec ] ]
[ deviceparameters ] :: mnemonicspec
timeout [ : mnemonicspec ]



    mnemonicspec::=

mnemonicspace
( L mnemonicspace )


    mnemonicspace::= expr V mnemonicspacename
    mnemonicspacename::=





ident



ident
digit
.
-




...

^ routineref1 [ ^ routineref2 ]






     



Note: period
Note: hyphen



There is a large overlap in specification between the commands Open, Use, and Close. As a side-effect of the alphabetical ordering of the commands, many features are described in clause 8.2.6, the Close command. As a matter of style in this document, these features are not repeated in this clause.

mnemonicspace specifies the set of controlmnemonics that may be used within format arguments to subsequent Read and Write commands. The mnemonicspace may be an empty string and may not provide any defined controlmnemonics. mnemonicspacenames that start with any character other than "Y" or "Z" are reserved for mnemonicspace definitions registered by the MDC; those that start with "Z" are implementor-specific.

The ^routineref alternative is a user-defined mnemonicspace and associates the routine named in routineref1 with the location of code to be executed when a controlmnemonic is used.

The user-defined mnemonispace command routine is the routine defined in routineref2, or if absent in routineref1. It associates this routine with the location of code to be executed when a command is used in conjunction with the mnemonicspace.

If an implementation does not provide for the use of a specific mnemonicspace then that implementation shall provide a mechanism by which to associate a routineref with this mnemonicspace. All subsequent references to this mnemonicspace are handled as if this were a user-defined mnemonicspace.

When a mnemonicspec contains a list of mnemonicspaces, the first one determines the active mnemonicspace. Subsequent Use commands may change the active mnemonicspace to any other mnemonicspace that is specified in this list.

If the device does not support a mnemonicspace in a mnemonicspec, an error condition occurs with ecode = "M35". If any mnemonicspaces in the mnemonicspec are incompatible, an error condition occurs with ecode = "M36".

In addition to controlmnemonics a mnemonicspace also defines the valid deviceattributes and devicekeywords which are associated with a device. deviceattributes and devicekeywords which start with the character "Z" are implementor-specific. Associated with each deviceattribute are one or more values which are held in the ssvn ^$Device.

See 8.2.7 for the syntax and interpretation of devn and deviceparameters.

The Open command is used to obtain ownership of a device, and does not affect which device is the current device or the value of $IO. (see the discussion of Use in 8.2.35)

For each openargument, the Open command attempts to seize exclusive ownership of the specified device. Open performs this function effectively instantaneously as far as other processes are concerned; otherwise, it has no effect regarding the ownership of devices and the values of the device parameters. If a timeout is present, the condition reported by $Test is the success of obtaining ownership. If no timeout is present, the value of $Test is not changed and process execution is suspended until seizure of ownership has been successfully accomplished by the process that issued the Open command.

In the case that a process has successfully executed an Open command for a certain device and has established certain operational parameters for that device, and subsequently the same process makes an attempt to execute an Open command for the same device while specifying different operational parameters, those established operational parameters that are controlled by the implementation, and for which new values are supplied, will be discarded, and an attempt will be made to establish the newly specified parameters as the current ones for the device in question.

Ownership is relinquished by execution of the Close command. When ownership is relinquished, all device parameters are retained. Upon establishing ownership of a device, any parameter for which no specification is present in the openparameters is given the value most recently used for that device; if none exists, an implementor-defined default value is used.

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 14-Nov-2023, 21:37:23.

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