Button for 1977 Button for 1984 Button for 1990 Button for 1995 Button for MDC Button for notes Button for examples
Left Hand Pointer

WRITE

Draft MDC Standard

Right Hand Pointer

8.2.38 Write

W[RITE] postcond SP L writeargument

    writeargument::=



format
expr
* intexpr
@ expratom V L writeargument




The writearguments are executed, one at a time, in left-to-right order. Each form of argument defines an output operation to the current device.

When the form of argument is format, processing occurs in left-to-right order.

    format::=

positionformat
/ controlmnemonic [ ( L expr ) ]


    positionformat::=



nlformat
ffformat


... [ tabformat ]

tabformat


    nlformat::= !
    ffformat::= #
    tabformat::= ? intexpr
    controlmnemonic::=

?
ident




ident
digit


...

The following describes the effect of specific characters when used in a format:

! causes a new line operation on the current device. Its effect is the equivalent of writing CR LF on a pure ASCII device. In addition, $X is set to 0 and 1 is added to $Y.
# causes a top of form operation on the current device. Its effect is the equivalent of writing CR FF on a pure ASCII device. In addition, $X and $Y are set to 0. When the current device is a display, the screen is blanked and the cursor is positioned at the upper left-hand corner.
? intexpr produces an effect similar to tab to column intexpr. If $X is greater than or equal to intexpr, there is no effect. Otherwise, the effect is the same as writing ( intexpr $X ) spaces. (Note that the leftmost column of a line is column 0.)
/ controlmnemonic [ ( expr [ , expr ] ... ) ]
produces an effect which is defined by the mnemonicspace which has been assumed by default or has been selected in a previous mnemonicspace specification with a Use command. The relevant control-function is indicated by means of the controlmnemonic which must be defined in the above-mentioned mnemonicspace. Possible parameters are given through the optional exprs. Controlmnemonics which start with the character "?" are implementor-specific.
The implementor may restrict the use of controlmnemonics in a device-dependent way. A reference to an undefined mnemonicspace or an undefined controlmnemonic is reflected in special variable $Device.

When the form of argument is expr, the value of expr is sent to the device. The effect of this string at the device is defined by appropriate device handling.

When the form of the argument is * intexpr, one character, not necessarily from the ASCII set and whose code is the number represented in decimal by the value of intexpr, is sent to the device. The effect of this character at the device may be defined by the implementor in a device-dependent manner.

As Write transmits characters one at a time, certain characters or character combinations represent device control functions, depending on the identity of the current device. To the extent that the supervisory function can detect these control characters or character sequences, they will alter $X and $Y as follows.

graphic : add 1 to $X
backspace : set $X = max($X - 1, 0)
line feed : add 1 to $Y
carriage return : set $X = 0
form feed : set $Y = 0, $X = 0

When a format specification is interpreted and the effect would cause the 'physical' external equivalent of $X and $Y to be modified, this effect will be reflected as far as possible in the values of the special variables $X and $Y.

Output operations, except when the form of the argument is * intexpr, are affected by the Character Set Profile output-transform.

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-2018 MUMPS Development Committee;
Copyright © Examples: 1995-2018 Ed de Moel;
Copyright © Annotations: 2003-2008 Jacquard Systems Research
Copyright © Annotations: 2008-2018 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, 11:39:04 .

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