Fundamentals of Dot Matrix Printing

Line 40 reveals that the variable M is used to control the number of times line 90 is executed. When I is small, M is large. When I is greater than 12, M is fixed to 2. Line 50 sets the vertical line spacing (you may recall that ESC = CHR$(27), “3” = CHR$(Sl)). So, in this program, line 50 sets the vertical spacing to 11144inches.

Line 60 starts a loop that uses the value of M to count 25 times when I equals 1, and counts 3 times when I is greater than 12. Line 70 prints a message telling us the value of the line spacing on the next-to-last line of the M loop. Line 80 spaces over the printing done by line 90 to column 30 by using the BASIC TAB statement.

Line 90 is where the action is. This line is similar to line 140 in the first reference program and prints 40 characters; its ASCII code is 241. This character is a six-dot straight line that is part of the block graphics set.

Line 100 and 110 end the J loops, and line 120 resets the printer and ends the program.

Discussion of the Vertical Spacing Program

Let’s start by looking at how close the dots are vertically in Figure 6-5. Remember that the normal characters are seven dots high, which is 141144ths (7/72nds) of an inch. Therefore, if you wanted to print text, say in all uppercase letters, with each line resting atop the next, you’d set the vertical spacing at 14/144th of an inch.

When we use block graphics (where each block is 6 dot- spaced high), we set the vertical spacing to 6/72 (or 12/144)inches.

The maximum value of n allowed for the vertical spacing control code is 127.The result is that almost one inch (127/144ths) for the ESC “3”n code, and roughly l-314 inches (127/72nds) for ESC “A” n.

In the sample program, we stopped I at 30, so the printout would fit on a standard 66-line sheet of sprocket-fed paper. If you wish to, you can replace the loop limit on line 20 with 127, and run the program again. You might also try replacing the CHRS(51)with CHR$(65) on line 50 and run the program using the n/72-inch vertical line spacing mode.

87

Page 93
Image 93
Gemini Industries Printer user manual Discussion of the Vertical Spacing Program