58
The (ESC)“J”CHR$(lOO) in line 50 changes the spacing to 100/180 inches for one line only without moving the printhead. The rest of the lines printed with the normal line spacing. Notice that both line 30 and line 50 end with semicolons. This prevents the normal line feed from occurring.
The (ESC)“j”CHR$(n) command works the same way except that the paper moves in the opposite direction. Try this simple change to your program and see what a difference it makes!
40 ’
50 LPRINT CHR$(27);“j”;CHR$(lOO);
LINE NUMBER 3.
LINE NUMBER 4.
LINE NUMBER 1.
LINE NUMBER 2.
PAGE CONTROL
Now that we have seen how to control line spacing, we can go on to page control - positioning the printing on the page and ad- justing the paper length.
nForm feed
The simplest forms control code is the form feed. Form feed (or < FF >) is CHR$(12) and causes the printer to move the paper to the top of the next sheet. Try it by changing lines 40 and 50 to this:
’ Form feed
;: LPRINT CHRS(12);
Before you run the program, turn your printer off and adjust the paper so that the top of the sheet is even with the top of the ribbon guide on the print head, then turn the printer back on. If you don’t remember how to do this, review Chapter 2. When you run the program, the results will look like this: