Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)
98 Chapter4
Using FDEVICECONTROL
Examples
Specifying an End-of-Record Character
You can change the character that will be recognized as the
end-of-record character for a device by specifying a control directive of
39 and passing the desired character in buffer. This
FDEVICECONTROL is effective in either standard and transparent
editing mode. Note that the call does not alter the editing mode in effect
for the device; it simply changes the character that will signal the end
of a record for that device. This capability is not available through any
FCONTROL function.
You might want to use this capability, for example, to make it possible
for carriage returns to be passed in your data without enabling binary
editing mode and without modifying the processing of any other special
character. Only the end-of-record character is affected by this control
directive.
A notable characteristic of this use of FDEVICECONTROL is that the
value of the new end-of-record character must be passed in the high
order byte of the buffer parameter. The low order byte is not used with
this control directive. (Two other FDEVICECONTROL control
directives, 40 and 41, also require that the value be passed in the high
order byte.)
In Figure 4-3, FDEVICECONTROL is used to change the end-of-record
character to a bracket (]). Again, the value of the character is specified
through the Pascal/iX ord function and is then multiplied by 256 to
place it in the high order byte. Read/Write access is set to Write only for
the call, so the previous EOR character will not be returned to the
program.
To return to normal end-of-record processing, call this
FDEVICECONTROL again, specifying a null value as the EOR
character. The EOR character will be reset to the default character,
which is the carriage return. If you were processing in transparent
mode prior to changing the EOR character, and want to return to using
the EOR character that you specified in the call that established
transparent mode, you need to explicitly reset the EOR to that
character.