☜ | READDraft MDC Standard | ☞ |
R[EAD] postcond SP L readargument
readargument | ::= | │ │ │ │ │ │ |
strlit format glvn [ readcount ] [ timeout ] * glvn [ timeout ] @ expratom V L readargument |
│ │ │ │ │ │ |
readcount | ::= | # intexpr |
The readarguments are executed, one at a time, in left-to-right order.
The forms strlit and format cause output operations to the current device; the forms glvn and *glvn cause input from the current device to the named variable (see 7.1.2.4 for a description of the value assignment operation). If no timeout is present, execution will be suspended until the input message is terminated, either explicitly or implicitly with a readcount. (See 8.2.35 for a definition of current device.)
If a timeout is present, it is interpreted as a t -second timeout, and execution will be suspended until the input message is terminated, but in any case no longer than t seconds. If t '> 0, t = 0 is used.
When a timeout is present, $Test is affected as follows. If the input message has been terminated at or before the time at which execution resumes, $Test is set to 1; otherwise, $Test is set to 0.
When the form of the argument is *glvn [ timeout ], the input message is by definition one character long, and it is explicitly terminated by the entry of one character, which is not necessarily from any standardized character set. The value given to glvn is an integer; the mapping between the set of input characters and the set of integer values given to glvn may be defined by the implementor in a device-dependent manner. If timeout is present and the timeout expires, glvn is given the value –1.
When the form of the argument is glvn [ timeout ], the input message is a string of arbitrary length which is terminated by an implementor-defined procedure, which may be device-dependent. If timeout is present and the timeout expires, the value given to glvn is the string entered prior to expiration of the timeout; otherwise, the value given to glvn is the entire string.
When the form of the argument is glvn # intexpr [ timeout ], let n be the value of intexpr. If n '> 0 an error condition occurs with ecode = "M18". Otherwise, the input message is a string whose length is at most n characters, and which is terminated by an implementor-defined, possibly device-dependent procedure, which may be the receipt of the n th character. If timeout is present and the timeout expires prior to the termination of the input message by either mechanism just described, the value given to glvn is the string entered prior to the expiration of the timeout; otherwise, the value given to glvn is the string just described.
When it has been specified that the current device is able to send control-sequences according to some mnemonicspace, the Read command will be terminated as soon as such a control-sequence has been entered (be it by typing a function-key or by some other internal process within the device). The value of the specified glvn will be the same as if instead of the control-sequence the usual terminator-character would have been received before the control-sequence was sent.
When the form of the argument is strlit, it is equivalent to Write strlit. When the form of the argument is format, it is equivalent to Write format.
$X and $Y are affected by Read the same as if the command were Write with the same argument list (except for timeouts and readcounts) and with each expr value in each writeargument equal, in turn, to the final value of the respective glvn resulting from the Read.
Input operations, except when the form of the argument is *glvn [ timeout ], are affected by the Character Set Profile input-transform. Output operations are affected by the Character Set Profile output-transform. (see 7.1.3.1 ^$Character)
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 15-Nov-2023, 14:47:37.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)