A BASIC example
Here’s an example you can typo in right now, to clarify what we’re saying.
It’s written in MicrosoflBASIC for a computerthat uses the
TheLPRINTcommandsallsenddatato theprinter.If thedatais something you wantprintedyoujust put it in quotationmarks. If the data is a control codeyoujust saywhereitisintheASCIItable,givingitspositionasaregular decimalnumber.
BASICusuallysendsa carnagereturnafterevery80characters,to keepthe print positionmovingwhenit hits the end of a line.
The<BEL>controlcode— ASCIIcode7— is sentin BASICas CHR$(7). The<ESC>codeitselfis CHR$(27).Andbecausewe’reusingthecharacter
4as part of an <ESC>command,we type CHR$(52)insteadof “4”. So if you start BASICand type thesecommands:
NEW
10 ‘ EXAMPLE
20tiIDTH “LPT1 :”, 255
30LPRINT CHR$(7)
40 LPRINT CHR$(27) ; CHR$(52)
50LPRINT “ITALICS ! “
60END
RUN
you make the printer(in
ITALICS!
Generally,when yousenda controlor Escapecodeit staysactiveuntilyou deactivateit. That’s what happensin line 40 of our program above. All subsequenttext willbe italicizeduntilyouchangeit back to uprightagain.
10