I
Controlcodesmostlyhandlecommunicationsbetweenyour computerand thepnnter.atthelowestlevel,atcablelevel.Forexample,a coupleofcontrol codesmakesurethe printerbufler(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 thenextpagejust as the PRINT buttondoes.
Escape sequences
Control code 27, <ESC> or Escape, is a particularlyimportantone for printers. To tell your printer all the things you might need— setting margins, saying where to print, choosing a particular font, starting graphics and so on— requires many more than just 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 you sendjust the character4 to the printerit will printa 4 and that’sall. 13utifyousendthe <ESC>codejust beforethe 4 thenthe printer (in
In this book we’ll leave spacesbetweencharacterswhen we show escape sequences.You’llfind
<ESC>(SopIOh 12vos 3T
a bit more readablethan
<ESC> (sOp10h12vOs3T
Butrememberthat you are not to sendthosespacesif you send commands to the printer.
To sumup, printercommandsare of two types.A controlcode is a single- charactercommandthat tellsyourprinterto do something,likemovedown one line. An Escapesequencecontrolsa printeroperationtoo, but is more thanonecharacterlong.Sincetheyarecommands,neithercontrolcodesnor escapesequencesam usuallyprintablecharacters.
8