Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
70 NEXT J<br />
80 FOR J==6 TO 0 STEP -1<br />
90 L-PRINT CHR$( 23);<br />
<strong>10</strong>0 NEXT .J<br />
1<strong>10</strong> NEXT I<br />
1 2 0 W I D T H "LPTI : " ,80<br />
'1:I 0 I. P R 1 N T<br />
:vivsli\~~w~w~~~~<br />
Figure F-6. A zigzag pattern created with 8-bit graphics.<br />
In line 30 of this program, we selected normal-density graphics<br />
and indicated that 350 characters of graphics data would follow (94 _<br />
+ (1 * 256) = 350). The loop between lines 40 and 1<strong>10</strong> is repeated<br />
25 times; this is what gives us the zigzag effect. The loop from lines<br />
50 to 70 creates the lines that slope up; the loop between lines 80<br />
and <strong>10</strong>0 prints downward-sloping lines. This is an example of plotting<br />
a very simple mathematical function to create a design.<br />
Combining<br />
text and graphics<br />
It’s also possible to mix text and graphics in one line. This can<br />
be useful for labeling charts and graphs, or even for inserting<br />
graphics into text. Try adding these lines to the program:<br />
25 LPRINT "WOW! " ;<br />
115 LPRINT " THIS IS GREAT!";<br />
If you run the program with these lines added, you should get a<br />
printout that looks like this:<br />
Figure F-7. Graphics pattern inserted within text.<br />
There is one thing you must remember when you print this kind<br />
of program: all graphics data must print on the same line. The<br />
graphics command is turned off at the end of each line, even if you<br />
have specified that more graphics codes will follow.<br />
-<br />
• PRINTING A DESIGN OR GRAPHIC PICTURE<br />
Since you control the firing of every pin, you can print nearly<br />
anything that you can draw. In our next example, we’ll demonstrate<br />
the printer’s ability to plot computer art of your own design.<br />
The best way to start is to lay out your image on graph paper.<br />
You can print eight rows (seven with a 7-bit interface) of dot columns<br />
with each pass of the print head, so begin by drawing a heavy hor-<br />
720