How the program works
Thisprogram begins by assigning anumber of printer commands toBASIC
stringvariables (lines 1000 to 1060).Youcan find most of these commands
near the beginning of chapter 8.
TheWIDTH “LPT1:“ 255 statementin line 1080 meansinfinite line width.
It prevents the IBM-PC from inserting unwanted carriage returns and line
feeds in graphics data.
Actual printing begins in line 1090.Using the preassigned commands, the
programprints samplesofits differentfonts, followedby samplesof theprint
pitches, then some double and quadruple-sized printing.
Next comes the central attraction of the program: aline of text printed
fourteentimes in expandingand contracting loops togiveabarrel effect.The
work isdone by four printer commands: acommand setting theright margin
(line 1400);acentering command (line 1420); acommandto vary the line
spacing (lines 1440and 1490); and acommand to micro-adjust the space
between characters (lines 1450and 1500).
Nextthe programreturns tonormal spacing andgives ademonstration of the
printer’s word-processing abilities: italic printing, bold printing, underlin-
ing, subscripts.etc.
The row of telephone 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 9.
Thefinal part ofthe program uses dotgraphics toprint an“M&W” logo.The
dotpattern of thelogo wasoriginally laid out ongraph paper, then converted
to thedata in lines 3180 to 4640 with the help of acalculator. Each number
represents eight verticaldots. (See “Graphics commands” in Chapter 8for
details.)
The pattern isprinted in three rows, each row is twenty-four dots high and
240dots wide. Line 1990 setsthe line spacing to 8/60 inch so that the rows
will connect vertically. The loop in lines2000 to 2080 does the printing in
three passes of the printhead.
The printout sample with this program isshown in page 7.
141