TOP AND BOTTOM MARGINS
Many programs that use a printer don’t keep track of where
they are printing on the page. This causes a problem 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.
And if you separate the pages then you are really in trouble.
Of course SG- 10/l 5 has a solution to this predicament.
SG- 10/l 5 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 and the other controls the space at the bottom of
the page. The control codes are given in the following table.
Table 6-4
Top and bottom margin commands
1 Function 1 Mode 1 Control code I
Set top margin STAR 1 < ESC > “R” CHR$(n)
IBM 1 < ESC > “r" CHRlXn)
Set bottom margin STAR < ESC > “IV’ CHR!$(n)
IBM <ESC> “N” CHR$(n)
clcartot3andbdtomrflarbs STAR <ESC> “0”
I -
I I IBM I -=ESC> w- I I
In both cases the value of n tells SG- lo/15 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) in STAR mode,
or with < ESC > “r” CHR$(n) in IBM mode, the value of n tells
SG- IO/ 15 what line to start printing on. When you set the bottom
margin with < ESC > “N” CHR$(n), the value of n tells SG-lo/15
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 top and bottom margins
20 LPRINT CHR$(12) ; 'Form feed.
30 FOR I = 1 TO 150
40 LPRINT "This is line" I
54) NEXT I
64) LPRINT CHR$(12) ; 'Form feed.
57