MPE/iX Intrinsics Reference Manual (32650-90905)
594 Chapter10
Command Definitions (QUIT-ZSIZE)
READX
READX
NM and CM callable.
Reads an ASCII string from $STDINX into an array.
Syntax
I16 CA I16V
length
:=READX(
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
The READX intrinsic reads an ASCII string from $STDINX into an array. This is similar to
calling the FREAD intrinsic against the file $STDINX. However, the READX intrinsic is limited
in its usefulness in that the full capability of the file system is not available to you. For
example, FILE commands are not allowed. Also, you cannot use certain file intrinsics
because the
filenum
parameter, obtained from either the FOPEN/HPFOPEN intrinsic, is not
normally available to users of the READX 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.
READX interprets EOD, EOF, or in a job, EOJ, JOB, or DATA as an end-of-file indicator.