Guardian Programmer's Guide

Table Of Contents
Communicating With Terminals
Guardian Programmer’s Guide 421922-014
10 - 11
Using the Line-Termination Character
Using the Line-Termination Character
A default line-termination character is configured for each terminal at system-
generation time. It is usually a carriage return. You can set the line-termination
character to any character you like using function 9 of the SETMODE procedure (see
Setting the Interrupt Characters for Conversational Mode later in this subsection).
An example explains how the line-termination mechanism works. Suppose a program
issues a READX procedure call with a read count of BUFSIZE:
CALL READX(TERM^NUM,
SBUFFER,
BUFSIZE,
COUNT^READ);
Then the user types the following information:
Now is the timeCR
initial cursor position
Following the read operation, the application buffer contains “Now is the time” in its first
17 bytes, and 17 is returned in the COUNT^READ variable.
At the terminal, the carriage return typically triggers a carriage return/line feed
sequence. Some terminals provide this feature automatically. For terminals that do
not provide this feature, the system sends the terminal a line feed character on receipt
of a carriage return. The system is configured to do this. You can use function 7 of the
SETMODE procedure to control whether the system sends the line feed character.
The following call causes the file system to send the line feed character automatically
on receipt of a carriage return from the terminal:
LITERAL LINE^FEED = 7,
ON = 1;
.
.
CALL SETMODE(TERM^NUM,
LINE^FEED,
ON);
The following call turns off automatic line feed:
LITERAL OFF = 0;
.
.
CALL SETMODE(TERM^NUM,
LINE^FEED,
OFF);