☜ | READ1984 Version of ANSI Standard | ☞ |
R[EAD] postcond L readargument
readargument | ::= | │ │ │ │ │ │ |
strlit format lvn [ readcount ] [ timeout ] * lvn [ timeout ] @ expratom V L readargument |
│ │ │ │ │ │ |
readcount | ::= | # intexpr |
The readarguments are executed, one at a time, in left-to-right order.
The top two argument forms cause output operations to the current device; the next two cause input from the current device to the named local variable. If no timeout is present, execution will be suspended until the input message is terminated, either explicitly or implicitly with a readcount. (See 3.6.16 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, $T is affected as follows. If the input message has been terminated at or before the time at which execution resumes, $T is set to 1; otherwise, $T is set to 0.
When the form of the argument is *lvn [ 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 the ASCII set. The value e: given to lvn is an integer; the mapping between the set of input characters and the set of integer values given to lvn may be defined by the implementor in a device-dependent manner. If timeout is present and the timeout expires, lvn is given the value –1.
When the form of the argument is lvn [ 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 lvn is the string entered prior to expiration of the timeout; otherwise, the value given to lvn is the entire string.
When the form of the argument is lvn # intexpr [ timeout ], let n be the value of intexpr. It is erroneous if n < O. 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 nth 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 lvn is the string entered prior to the expiration of the timeout; otherwise, the value given to lvn is the string just described.
When the form of the argument is strlit, that literal is output to the current device, provided that it accepts output.
When the form of the argument is format, the output actions defined in 3.5.4 are executed.
$X and $Y are affected by READ the same as if the command were WRITE with the same argument list (except for timeouts) and with each expr value in each writeagrument equal, in turn, to the final value of the respective lvn resulting from the READ.
See also the transition diagram for Read.
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.
This page most recently updated on 15-Nov-2023, 14:47:37.
For comments, contact Ed de Moel (demoel@jacquardsystems.com)