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

100 Chapter4
Using FDEVICECONTROL
Examples
Controlling Backspace Processing
Among the capabilities provided by FDEVICECONTROL which are not
available through other intrinsics is the ability to manipulate how
backspace processing takes place at a device. You can specify the
character that the DTC will recognize as a backspace when it is sent
from a specific device. You can also, to a limited extent, control the
action that the DTC will take as a result of the backspace character
being entered at a specific device. These controls are independent of
each other, enabling you to change either the backspace character, the
backspace response, or both, depending on the needs of your
application. They are only useful in standard editing mode, since
backspace is not recognized as a special character in either transparent
or binary editing modes.
You use FDEVICECONTROL with a control directive of 36 to change
the character that the DTC will recognize and act on as a backspace
character. In the program fragment shown in Figure 4-4, the backspace
character in effect for the devicefile whose file number is contained in
port is set to a dollar sign ($), using the Pascal/iX ord function to
specify its value. The program then notifies the user that the backspace
character has been changed. Read/Write access is set to 2, which means
that the backspace character previously in effect will not be returned.
If a dollar sign is entered at the device after successful execution of the
program, it will be treated as a backspace, and the DTC will perform
backspace processing. The dollar sign will not be echoed to the
terminal, nor will it be passed in the data stream as a character of data.
In addition, the special processing characteristics normally associated
with the backspace character itself (
[CTRL]H) will be disabled, and, if a
backspace is entered from the device, it will be passed in the data
stream.