Controlcodesmostlyhandlecommunicationsbetweenyourcomputerand
theprinteratthelowestlevel,atcablelevel.Forexample,acoupleofcontrol
codesmakesurethe printerbuffer(yourprinter’sstoragememory)doesn’t
overflow.In this book we’ll indicate controlcodes enclosed by angle
bracketsto their abbreviationsin thetable: =&I%-meansthe Form Feed
controlcode,whichadvancestheprintertothe nextpagejustas thePRINT
button.does.
1.2.4Escape sequences
Controlcode 27, cESG or Escape, is aparticularlyimportantone for
printers.Totellyourprinterallthethingsyoumightneed- settingmargins,
sayingwhereto print, choosingaparticularfont,starting graphicsandso
on- requiresmanymorethanjusttwo orthreedozencontrolcodes.So the
<ESC> control code has aspecialmeaning: <ESC> means “the next
characterspecifiesacommand,notsomethingto beprinted”.
Thereforeifyou sendjustthe character4tothe printerit willprint a4and
that’sall. Butif you sendthecESC> codejustbeforethe4 thentheprinter
(in FX-850 mode)will switch overto italicstext. Extendingthe control
codesthisway givesyoumany morecommandstocontrolyourprinter.In
fact,these“Escapesequences”makeupmostof theStarLaserPrinter’skm-
guage.
In thisbook we’llleave spacesbetweencharacterswhenwe show escape
sequences.You’llfind
<ESC>(S@IOh12vos 3T
abitmore readablethan
<ESC>(sOp10h12vOs3T
Butrememberthatyou arenotto send thosespacesif yousend commands
tothe printer.
Tosum up,printercommandsare oftwotypes. Acontrolcodeis asingle-
charactercommandthattellsyourprintertodo something,likemovedown
oneline. AnEscapesequencecontrolsaprinteroperationtoo, butis more
thanonecharacterlong.Sincetheyarecommands,neithercontrolcodesnor
escapesequencesareusuallyprintablecharacter.
8