Star Micronics NX-15 Top And Bottom Margins, Set topmarginton lines, ESC“r”CHR$n, ESC“N”CHR$n

Models: NX-15

1 210
Download 210 pages 57.72 Kb
Page 71
Image 71
TOP AND BOTTOM MARGINS

63

TOP AND BOTTOM MARGINS

Some programs don’t keep track of where they are printing on the page. This causes problems when you get to the bottom of a page because these programs just keep on printing, right ‘over the perforation. This makes it very hard to read, especially if a line happens to fall right on the perforation.

The printer has a solution to this predicament. This printer can keep track of the position on the page, and advance the paper so that you won’t print too near the perforation. There are two commands to do this. One controls the space at the top of the page (top margin) and the other controls the space at the bot- tom of the page (bottom margin). The control codes are given in the following table:

Table 5-5

Top and bottom margin commands

Function

Control code

Set topmarginton lines

(ESC)“r”CHR$(n)

Setbottommarginton lines

(ESC)“N”CHR$(n)

Canceltopandbottommargins (ESC) “O”

In both cases the value of n tells your printer how many lines to skip, although there is a slight difference in the usage. When you set the top margin with (ESC) “r” CHR$(n), the value of n tells the printer what line to start printing on. When you set the bottom margin with (ESC) “N” CHR$(n), the value of n tells the printer how many blank lines should be left at the bottom of the page.

Let’s try a simple application to see how these margins work. Enter this program, which will print 150 lines without top and bottom margins.

10‘Demo of top :indbot tom margins

60 LPRINT CHR$(12); :‘ form feed

70 FOR I=1 ‘TO15(j /30LF’RINT“’THISIS LINE”;I 90 NEXT I

1.10LF’RINT CHR$(12) :‘ form feed 120 END

Page 71
Image 71
Star Micronics NX-15 Top And Bottom Margins, Set topmarginton lines, ESC“r”CHR$n, Setbottommarginton lines, ESC“N”CHR$n