A SERVICE OF

logo

Chapter 6
All That Work for one Line?
We shouldn’t complain too loudly. It works, and no one said creating graphics
was easy.
Our current “universal” program can only handle one line of DATA, and it’s
becoming increasingly apparent that HI-RES graphics requires lots of lines of
DATA. The following simple changes allow it to handle virtually unlimited
amounts of DATA:
15 ONERR GOT0 900
(TRS-80 etc. use on ERROR GOTO)
130 PRINT : GOT0 20
Line 130 creates an infinite loop, sending execution back to the READ
statement after printing each line.
Line 15 gives the program a smooth ENDing when the DATA is all READ.
When there is no more DATA, an OUT-OF-DATA error message appears,
and the program is cleanly ended, even resetting the printer line spacing
back to its “power-up” default.
Let’s add 2 more lines of DATA to see how it works:
1000 DATA 49,-8,0,3,15,63,-34,0,63,15,3,0
1010 DATA 49,-7,0,63,-3,127,7,-32,0,7,-3,127,63
and RUN.
Figure 6-3
It sprouted flowers!
54