
LineSpacingandFormsControl51
In both cases the value of n tells Delta 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 Delta what line to start printing on. When you set the bottom margin with (ESC) “N” CHR$(n), the value of n tells Delta 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.
NEW
3p,FOR I = 1 TO 15g
4@ LPRINT "THIS IS LINE "; I 5jilNEXT
7plLPRINTCHR$(12);
When you run this program it will print 150 lines right down the page and across the perforations. When it’s done line 70sends a form feed to advance the paper to the top of the next page. Look at the lines that have printed near the perforations. Separate the sheets and see if any of the lines have been torn in half. These are the problems that the top and bottom margins will solve.
Now add the following lines to your program. (Don’t forget the semicolons or you won’t get quite the same results that we did.)
18LPRINTCHR$(27)"N" CHR$(6); 2@ LPRINTCHR$(27)"R" CHR$(6); 6p LPRINTCHR$(27)"0";
Now when you run the program Delta will skip the first six lines and the last six lines on each page (except for the first page, where Delta started printing at the top). That’s because the top margin only works after a form feed, and we didn’t send Delta a form feed after we set the top margin.
Line 10 sets the top margin, line 20 sets the bottom margin, and line 60 clears both margins when we are done.