Guardian Programmer's Guide

Table Of Contents
Communicating With Printers
Guardian Programmer’s Guide 421922-014
11 - 27
Printing Text
@S^PTR '-' @SBUFFER);
IF <> THEN ...
Underlining Text
To underline text, write an escape sequence in the following format to the printer:
All text following the underline escape sequence is printed underlined up to the escape
sequence that turns off underlining. By default, underlining is turned off.
The following code fragment shows an example for the 5515/5516/5518 printers:
STRING .START^UNDER[0:3] := [%33,"&dD"];
STRING .STOP^UNDER[0:3] := [%33,"&d@"];
.
!Send the start-underlining escape sequence:
CALL WRITEX(PRINTER^NUM,START^UNDER,$LEN(START^UNDER));
IF <> THEN ...
!Send the text to be printed underlined:
SBUFFER ':=' "This is underlined text," -> @S^PTR;
CALL WRITEX(PRINTER^NUM,SBUFFER,@S^PTR '-' @SBUFFER);
IF <> THEN ...
!Send the stop-underlining escape sequence:
CALL WRITEX(PRINTER^NUM,STOP^UNDER,$LEN(STOP^UNDER));
IF <> THEN ...
!Subsequent text is not underlined:
SBUFFER ':=' " and this is not. " -> @S^PTR;
CALL WRITEX(PRINTER^NUM,SBUFFER,@S^PTR '-' @SBUFFER);
IF <> THEN ...
The above example prints the following text:
This is underlined text, and this is not.
Overstriking Text
The 5515/5516/5518 printers support two ways to print characters on top of each
other:
Print adjacent lines on top of each other by calling the SETMODE procedure with
function 6 selected.
Note. You cannot change the pitch in the middle of a line.
Escape sequence for underlining text:
esc&dD
Escape sequence to turn off underlining:
esc&d@