I
Controlcodesmostlyhandlecommunicationsbetweenyourcomputerand
thepnnter.atthelowestlevel,atcablelevel.Forexample,acoupleofcontrol
codesmakesuretheprinterbufler(yourprinter’sstoragememory)doesn’t
overflow. In this book we’ll indicate control codes enclosed by angle
bracketsto their abbreviationsin the table:<FF> means the Form Feed
controlcode,whichadvancestheprinterto thenextpagejustasthePRINT
buttondoes.
Escape sequences
Controlcode 27, <ESC> or Escape, is a particularlyimportantone for
printers. Totell your printer allthe thingsyou might need— settingmargins,
saying where to print, choosing a particular font, starting graphics and so
on— requires many more thanjust two or three dozen control codes. So the
<ESC> control code has a special meaning: <ESC> means “the next
character specifies a command, not something to be printed”.
Thereforeif yousendjust the character4 to theprinterit willprinta 4 and
that’sall. 13utifyousendthe<ESC>codejustbeforethe4 thentheprinter
(in EX-800
mode) will switch over to italics text. Extending the control
codes this way gives you many more commands to control
yourprinter.in
fact,these“Escapesequences”makeupmostoftheStarLaserPnntcr’slan-
guage.
In thisbook we’llleavespacesbetweencharacterswhenwe showescape
sequences.You’llfind
<ESC>
(SopIOh12vos 3T
a bitmorereadablethan
<ESC>(sOp10h12vOs3T
Butrememberthatyouarenotto sendthosespacesif yousendcommands
to theprinter.
To sumup,printercommandsareof twotypes.A controlcodeis a single-
charactercommandthattellsyourprintertodosomething,likemovedown
oneline.An Escapesequencecontrolsa printeroperationtoo,butis more
thanonecharacterlong.Sincetheyarecommands,neithercontrolcodesnor
escapesequencesamusuallyprintablecharacters.
8