Remember to use the proper format for your system for the WIDTH statement in line 90.

In this program the number 128 in the DATA statements signals the end of a print line. This is the reason for the IF-THEN statement in line 610 that skips to line 650 and causes a line feed.

The other special technique used in this program is found in lines 620 and 630. Since some of the data numbers are repeated many times, using negative DATA numbers for repetitions saves typing. Line 620 tests for a negative number, and if it finds one, reads the next two numbers and prints their pin patterns the number of times indicated by the negative number.

For example, when the minus 6 in line 800 is read, the program then reads the next two numbers (8 and 0) and sends them to the printer 6 times. This feature is not a necessary part of the program, but it does allow you to type fewer data numbers.

Otherwise the program is a straightforward graphics program that uses seven-dot line spacing and reads numbers from DATA statements and sends them to the printer. If you want to see the figure in other densities, change the “Y” in line 600 to “L” or “Z”.

String variables

In a long and complicated graphics program, typing in the graphics command or repetitive data numbers over and over can become time- consuming. You can avoid much of the repetitive typing by storing commands and data in string variables.

Look at the program below. It is the same as the multiple-line exer cise earlier in the chapter except for the string variables.

10 WIDTH "LPT1:",255

20G$=CHR$(27)+"K"+CHR$(100)+CHR$(0)30A$=CHR$(85)+CHR$(42)40B$=CHR$(42)+CHR$(85)50 LPRINT CHR$(27)"A"CHR$(7)60FOR R=1 TO 370LPRINT G$;80FOR X=1 TO 50: LPRINT A$;: NEXT X

90LPRINT 100 LPRINT G$;

110 FOR X=1 TO 50: LPRINT B$;: NEXT X120 LPRINT: NEXT R130 LPRINT CHR$(27)"@"

6-14