
1.2.7A BASICexample
Here’san exampleyou can typein rightnow, to clarifywhatwe’resaying. It’s written in Microsoft BASIC for a computerthat uses the
TheLPRINTcommandsall senddatato theprinter.If thedatais something you want printedyoujust put it in quotationmarks. If the data is a control codeyoujust saywhexeitisintheASCIItable,givingitspositionasaregular decimalnumber.
BASICusuallysendsa carriagereturnafterevery 80character, to keepthe print positionmovingwhenit hits the end of a line.
The <BEL>controlcode— ASCIIcode7
4as part of an cESC> command,we type CHR$(52)insteadof “4”. So if you start BASICand type thesecommands:
NEW
10 ‘ EXAMPLE
20 WIDTH “LPT1:“,255
30 LPRINTCHR$(7)
40LPRINTCHR$(27);CHR$(52)
50 LPRINT“ITALICS!“
60END RUN
ITALICS!
Generally,when yousend a controlor Escapecodeit staysactiveuntilyou deactivateit. That’s what happensin line 40 of our programabove. All subsequenttext willbe italicizeduntilyouchangeit back to uprightagain.
10