How the program works
Thisprogram begins byassigning anumberof printercommands toBASIC string variables
(lines 1000to 1050).You can find most of these commands near the beginning of chapter
6.
TheWIDTH “LPT1 :“255 statement in line 1070 means infiniteline width. It prevents the
IBM-PC from inserting unwanted carriage returns and line feeds in graphics data.
Actual printingbegins in line 1080. Using the preassigned commands, the program prints
samplesof its different fonts, followed by samples of the print pitches, then some double
and quadruple-sized printing.
Next comes the central attraction of the program: aline of textprinted fourteen times in
expanding and contracting loopsto give abarrel effect. The work is done by four printer
commands: acommand setting the right margin (line 1340);acentering command (line
1360);acommand tovary the linespacing (lines 1380 and 1430);andacommand to micro-
adjustthe space between characters (lines 1390 and 1440).
Next the program returns to normal spacing and gives ademonstration of the printer’s
word-processing abilities:italic printing, bold printing, underlining, subscripts, etc.
The row oftelephone symbols in the next printed line is created by downloading two new
character patterns, which are printed in place of the character “<” (character 60). Details
can be found in Chapter 7.
The finalpart of the program uses dot graphics to print an “M &W“ logo. The dot pattern
ofthe logo was originally laid out on graph paper, then converted to the data in lines 2800
to 4260 with the help of acalculator. Each number represents eight vertical dots. (See
“Graphics commands” in Chapter 6for details.)
The pattern isprinted in three rows, each row is twenty-four dots high and 240 dots wide.
Line 1870setsthe linespacing to8/60 inchso thatthe rowswill connectvertically. The loop
in lines 1880to 1960 does the printing in three passes of the print head.
Chapter8 MS-DOS AND YOUR PRINTER 85