40
Line 40 changes the line spacing. The command (ESC) “A”
CHR$(n) changes the line spacing to n/72 of an inch. The loop
that is started in line 20 increases the value of n (the variable I in
this program) each time it is executed. So the line spacing in-
creases as the program continues. Line 30 just shortcuts the
loop when I = 13, since BASIC won’t let us send CHR$(13)
without adding an unwanted CHR$( 10) to it. Finally, the (ESC)
“2” in line 80 resets the line spacing to 6 lines per inch. This is a
shortcut that is the same as (ESC) “A” CHR$(lB).
When you run this program with the DIP switch l-6 off (IBM
mode), you cannot get the printout as shown above.
The (ES0 “A” CHR$(n) command in IBM mode only defines
the line spacing as n/72 of an inch; the (ES0 “2” command
changes the line spacing to the amount defined by the previous
(ES0 “A”.
So, you need to change the following lines to the previous pro-
gram as shown below for the IBM mode:
40 LPRINT CHR$(27);"A";CHR$(I);CHR$(27);"2";
80 LPRINT CHR$(27);"A";CHR$(12);CHR$(27);"2"
You may wonder why l/72 of an inch was chosen as the incre-
ment for the line spacing command. There’s a good reason: the
dots that the printer makes are l/72 inch apart. So this means
that you can vary the line spacing in increments as fine as one
dot - unless you want finer spacing, in which case you may use
one third dot spacing.
The (ESC) “3” CHR$(n) command sets the line spacing in in-
crements of l/216 inch. Change line 40 in your program to this:
40 LPRINT CHR$(27);"3";CHR$(I) ;
and run the program again. Now the results will look like this:
-
-