Laser Printer User Manual
1.2.7A BASICexample
Here’sanexampleyoucantypein rightnow,to clarifywhatwe’resaying.
It’s written in MicrosoftBASIC for a computerthat uses the MS-DOS
operatingsystem,so if youhavea differentcomputeror BASICyou may
havetotranslateabit.We’llshowcommandsthewaythey’rewrittenforan
Epsondot-matrixprinterbecauseyourStarLaserPrinter4understandsthose
commands.
TheLPRINTcommandsallsenddatatotheprinter.Ifthedataissomething
youwantprintedyoujust putit in quotationmarks.If the datais a control
codeyoujustsaywhexeitisintheASCIItable,givingitspositionasaregular
decimalnumber.
BASICusuallysendsacarriagereturnafterevery80character, tokeepthe
print positionmovingwhenit hitstheendof a line.Unasked-forcarriage
returnscanmessup yourprinting,however,so it’sa goodhabitto putin a
WIDTHstatementas shown.Thatletsus printoverthe wholepage area.
The<BEL>controlcode—ASCIIcode7—is sentinBASICasCHR$(7).
ThecESG codeitselfisCHR$(27).Andbecausewe’reusingthecharacter
4 as partof an cESC> command,we typeCHR$(52)insteadof “4”.
So if youstartBASICandtypethesecommands:
NEW
10 ‘ EXAMPLE
20 WIDTH “LPT1:“,255
30 LPRINTCHR$(7)
40 LPRINTCHR$(27);CHR$(52)
50 LPRINT“ITALICS!“
60 END
RUN
youmaketheprinter(inFX-850mode)firstsounditsbell-most peoplecall
it a beeper—andthenprinttheline:
ITALICS!
Generally,whenyousendacontrolorEscapecodeit staysactiveuntilyou
deactivateit. That’swhathappensin line 40 of our programabove.All
subsequenttextwillbe italicizeduntilyouchangeitbackto uprightagain.
10










