Also, note that Autowrapdoesn’tmove the wholeword down to the next line—that’s a job for a word processor,not yourlaser printer.

Pushing and popping the print position

This providesa wonderfulway to keep trackof the printposition.it works by lettingyoukeep a list of up to 20 print positions.

You can “push”the currentprintpositionontothe top of the list whenever youwant.Later,youcan“pop”off whateverpositionis at thetop of thelist, makingit the currentprintposition.

When would you want to save and restore print positions this way? Wheneveryouneedto interruptwhatyou’reprintingnowto sticksomething specialonto thepage.This is mosthandywhenyouneedtojump fromtext to graphicsand back.

Say you’vewrittenone routinethatputsthepagenumberin the sameplace on .evcry page, and another that under certain circumstancesprints two heavyIincs. You printmcrnly alonguntil you have to print the lines. You then push the currentprint positionto executethe line-printingroutine.

But part way throughthat you hit the page-numberspot. So you push the printpositionagainandrunthepage-numberroutine.Then youcan popthe printpositiontoprintthesecondline.Andwhenthat’sdoneyoupopit again to returnto printingtext.

As you might suspect,this can involvefairly complicatedprogramming, typicallyusingthe macro commandsdescribedlater in this chapter.

To push or pop a printpositionyou send this command:

<ESC>&f n S

For n you enter Oto push (save)the currentprint position,

or 1 to pop (restore)the last positionsavedoff the list. Note: The last positionpushed onto the list will alwaysbe the first onc

poppedback later.

69

Page 77
Image 77
Star Micronics 8 Series manual Pushing and popping the print position