Asynchronous Terminals and Printer Processes Programming Manual

PROCEDURE CALLS FOR ACCESSING TERMINALS
OPEN
To access the home terminal associated with the running of an
application process, include the following code in your program:
INT .HOME^TERM [0:11], ! data declarations
HOME^TERM^NUM, !
.TERM^BUFFER[ 0:35 ]; !
.
CALL MYTERM ( HOME^TERM );
.
CALL OPEN ( HOME^TERM, HOME^TERM^NUM );
.
MYTERM is a process-control procedure that returns the file name
of the home terminal. OPEN returns a file number for use in
calls to other file system procedures to access the terminal.
WRITE
To write to the terminal, include the following call:
.
CALL WRITE ( HOME^TERM^NUM, TERM^BUFFER, 72, NUM^WRITTEN );
.
Seventy-two characters of TERM^BUFFER are written to the
terminal; the actual number of characters written is returned in
NUM^WRITTEN.
READ
To read from a terminal, include the following call:
.
CALL READ ( HOME^TERM^NUM, TERM^BUFFER, 72, NUM^READ );
.
In this case, assuming I/O with wait, the application process is
suspended until a line is input on the terminal. The maximum
number of characters permitted is 72. The actual number of
characters read is returned in NUM^READ.
3-3