Also,notethatAutowrapdoesn’tmovethe wholeworddownto thenext
line—that’sajob for a wordprocessor,notyourlaserprinter.
Pushing and popping the print position
Thisprovidesa wonderfulwayto keeptrackoftheprintposition.it works
by lettingyoukeepa listof up to 20printpositions.
Youcan“push”thecurrentprintpositionontothetopof thelistwhenever
youwant.Later,youcan“pop”offwhateverpositionisatthetopofthelist,
makingit thecurrentprintposition.
When would you want to save and restore print positions this way?
Wheneveryouneedtointerruptwhatyou’reprintingnowtosticksomething
specialontothepage.Thisismosthandywhenyouneedtojump fromtext
to graphicsand back.
Sayyou’vewrittenoneroutinethatputsthepagenumberin thesameplace
on.evcrypage, and anotherthat under certain circumstancesprints two
heavyIincs.Youprintmcrnly alonguntilyouhaveto printthelines.You
thenpushthecurrentprintpositionto executetheline-printingroutine.
Butpart waythroughthat youhit the page-numberspot.So youpushthe
printpositionagainandrunthepage-numberroutine.Thenyoucanpopthe
printpositiontoprintthesecondline.Andwhenthat’sdoneyoupopitagain
to returnto printingtext.
As youmightsuspect,this can involvefairlycomplicatedprogramming,
typicallyusingthemacrocommandsdescribedlaterin thischapter.
To pushorpopa printpositionyousendthiscommand:
<ESC>&f n S
For n youenter Oto push(save)thecurrentprintposition,
or 1to pop(restore)thelastpositionsavedoff thelist.
Note: The last positionpushedonto the list will alwaysbe the first onc
poppedbacklater.
69