like this one, you can just get the program to reread one set of data by using a RESTORE statement. To see this, change two lines and then RUN the program:

30 FOR Y=l TO 19: RESTORE: LPRINT A$;79 NEXT X: NEXT Y

Although the new loop in line 30 repeats the pattern 10 times, you don’t need 10 repetitions of the DATA statements. The RESTORE statement in line 30 tells the program to read the same data again. If you use it carefully, the RESTORE statement can reduce the amount of data that you need to type in for a graphics pattern.

Repeated DATA numbers

Sometimes you will want to repeat the same DATA number several times in succession. Here’s a change that gives an instance:

90 DATA 8,28,62,93,28,28,28,28,28,28,93,62,28,8

At the center of this program line you fire the middle three pins-with CHR$(28)-six times in succession. Six 28s was boring enough to type. Can you imagine typing the data for 20 or 50 repetitions of the same number? There has to be a-better way-and there is.

You can enter the number of repetitions right into the DATA lines, coded as a negative number. Then change the READ routine to test for a negative number. When the program reads a negative number, it transfers control to a special subroutine that does the repeating. (Or you could use a STRING$ statement.)

Change lines 50 and 90, and add lines 100, 110, and 120 so that your listing looks like this:

20A$=CHR$(27)+"K"+CHR$(14)+CHR$(0)

30FOR Y=1 TO 10: RESTORE: LPRINT A$;40FOR X=1 TO 1450READ N: IF N<0 THEN 10060LPRINT CHR$(N);70NEXT X: NEXT Y

156