Asynchronous Terminals and Printer Processes Programming Manual

PROCEDURE CALLS FOR ACCESSING TERMINALS
WRITEREAD
WRITEREAD
The WRITEREAD procedure ensures that the computer is ready to
receive data from a terminal immediately after a message is
written to a terminal. This is useful when conversationally
prompting a terminal user for input.
For example, to prompt a terminal user with a colon (:) and then
wait for input, use the following code in your program. Only one
buffer, TERM^BUFFER, is specified; the data is returned there.
TERM^BUFFER := ": "; ! specify the prompt character
.
.
CALL WRITEREAD (HOME^TERM^NUM, TERM^BUFFER, 1, 72, NUM^READ);
The WRITEREAD call displays a colon on the terminal and then
waits for input. Note that WRITEREAD does not issue a carriage
return/line feed character sequence to the terminal after the
write phase of the WRITEREAD.
The WRITEREAD procedure is useful for issuing control commands
to a terminal. For example, to read a seven-character cursor
address from a terminal that requires a control character
sequence of "<ESC> a <DC1>" (an escape character, followed by
lowercase letter "a," followed by a DC1 character), you could
include the following code:
TERM^BUFFER ':=' [ %015541, %010400 ]; ! "ESC a DC1"
.
.
CALL WRITEREAD ( HOME^TERM^NUM, TERM^BUFFER, 3, 7, NUM^READ );
After the WRITEREAD, TERM^BUFFER contains the cursor address, and
seven is returned to NUM^READ.
AWAITIO
Operations with terminals require human response and, therefore,
can take an indefinite period of time. Use the
time-limit
parameter to ensure that a terminal operator performs an opera-
tion within a specified period of time. The terminal must have
been opened to permit nowait I/O.
3-4