Note: Even when Autowrap is on, the printer will print beyond the right
margin if you have sent one of the direct positioning commands
described above, which move theprint position past the margin.
Also, note that Autowrap doesn’t move the whole word down to the next
linethat’s ajob for aword processor, not your laser printer.
4.4.17 Pushing and popping the print position
This provides awonderful way to keep track of the printposition. It works
by letting you keep alistof up to 20 print positions.
You can “push” the current print position onto the top of the listwhenever
youwant. Later, you can “pop” off whatever position is atthe top of the list,
making itthe current print position.
When would you want to saveand restore print positions this way? When-
ever you “needto interrupt what you’re printing now to stick something
specialonto the page. This is most handy when you need to jump from text
to graphics and back.
Say you’vewritten one routine that puts the page number in the same place
onevery page, and another thatunder certaincircumstances printstwo heavy
lines.You print merrilyalong until youhave to print thelines.You then push
the current print position to execute the line-printing routine.
Butpart waythrough thatyouhit thepage-number spot. Soyoupush theprint
positionagain and run the page-number routine. Then you can pop the print
position to print the second line. And when that’s done you pop it again to
return to printing text.
As you might suspect, this can involve fairly complicated programming,
typically using the macro commands described later in thischapter.
To push or pop aprint position you send thiscommand:
<ESC> &f nS
Fern youenter Otopush(save) thecurrent print position,or 1topop (restore)
the lastposition saved off the list.
60