Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)

Chapter 9 279
Intrinsics Reference (cont)
READX
READX
Transfers a record of data from the file $STDINX to the data area.
Syntax
I16 CA I16V
transfercount
:=READX(message,expectedlength);
Use
The READX intrinsic reads an ASCII string from $STDINX into an
array. This is similar to calling the FREAD intrinsic against the file
$STDINX. READX is intended as a quick method of obtaining input
from the terminal for temporary programming.Read timers or timeouts
must be set prior to calling READX by first calling FCONTROL using
the appropriate controlcode values.
When you use the READ intrinsic, the full capabilities of the file system
are not available to you. For example, since no file number can be
specified in the call, it is not possible to use the :FILE command to
redirect input for programs using READX. (The only way that input can
be redirected is to use the $STDINX=filename option of the :RUN
command.) Input always comes from the $STDINX file opened by the
session at logon time.
READX differs from READ in how it interprets an end-of-file. READX
interprets :EOD as an end-of-file indication.
Functional Return
transfercount 16-bit signed integer (assigned functional
return)
The length of the ASCII string that was read. If
expectedlength is positive, the count represents
halfwords. If expectedlength is negative, the count
represents bytes.
Parameters
message character array (required)
Returns the ASCII characters that were read. Note
that all character arrays must start on a halfword
boundary
expectedlength 16-bit signed integer by value (required)