MPE/iX Intrinsics Reference Manual (32650-90905)
592 Chapter10
Command Definitions (QUIT-ZSIZE)
READ
READ
NM and CM callable.
Reads an ASCII string from $STDIN into an array.
Syntax
I16 CA I16V
length
:=READ(
message,msglength
);
Functional Return
length
16-bit signed integer (assigned functional return)
The length of the ASCII string that was read. If
msglength
is positive, the
length specified is in half words; if negative, the length specified is in
bytes.
Parameters
message
character array (required)
Returns the ASCII characters that were read.
msglength
16-bit signed integer by value (required)
Returns the length of
message
. If
msglength
is positive, it specifies the
length in half words; if negative, it specifies the length in bytes. When the
record is read, the first
msglength
characters are input. If
msglength
is
>= record size of
message
, the entire record is transmitted.
NOTE Passing a value >
message
can cause user data corruption or a CCL (1) bounds
violation if the system could be corrupted by the call.
Operation Notes
Reads an ASCII string from $STDIN into an array. This is similar to calling the FREAD
intrinsic against the file $STDIN. This intrinsic is limited; full capability of the file system
is not available. For example, FILE commands are not allowed and some file intrinsics
cannot be used because the
filenum
parameter, obtained from the FOPEN/HPFOPEN
intrinsic, is not normally available to users of the READ intrinsic.
Basic line editing, such as cancellation of lines and backspacing, are performed
automatically by the I/O driver. If the input device is a terminal in full-duplex mode with
the ECHO facility on, or if the terminal is in half-duplex mode, the characters read are
printed.
READ interprets the following to be end-of-file (EOF) markers when they begin in the fist
column of a record: