☜ | READM[UMPS] by Example | ☞ |
Introduced in the 1977 ANSI M[UMPS] language standard.
Read "Please enter your name: ",NAME
Write "Please enter your name: " Read NAME
Both lines of code seemingly have the same effect. On some
implementations, the former example has the side-effect to flush
the type-ahead buffer.
Read X#20
Read a string of fixed length (do not wait for a terminator).
Read X:20
Read a string. When a ‘terminator’ key is pressed, the
Read command will be satisfied. If, after 20 seconds, no
‘terminator’ key has been pressed, the Read command will
also be satisfied. In this case, the value returned in X
is ‘as many characters as have been entered before the time-out
elapsed’.
Read *X:20
Read a single character. The value returned in X will be
an integer number. If the time-out expires, this value will be
–1.
Addition in the 1984 ANSI M[UMPS] language standard.
Read X#1
Read *X
Both lines of code read one single character. The first line
always returns a string of length 1 in local variable X.
The second line returns an integer value in local variable
X; although practically all implementations return the
ASCII code of the character processed, the value returned in
local variable X is implementation-specific and device
specific and it is not to be considered portable to rely on a
specific value being returned.
Addition in the 1995 ANSI M[UMPS] language standard.
Read ^ABC
It is allowed to read values directly into global variables.
Approved for addition in a future M[UMPS] language standard.
The ability to specify an "output time-out" is added. An output time-out is specified as a device parameter in an OPEN or USE command. Examples are shown with the Use command.
User-definable I/O handling has been added. When user-definable I/O handling is active:
Examples with naked references:
Read VARIABLE
Set ^ABC(1,2)="reset naked indicator"
; naked indicator is now ^ABC(1,
Read ^(3,4)
; naked indicator is now: ^ABC(1,3,
; Actual reference is: ^ABC(1,3,4)
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.
The information in this page is
NOT authoritative and subject to be modified
at any moment.
Please consult the
appropriate (draft) language standard for an
authoritative definition.
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)