Overcoming the DATA statement in BASIC

2 posts / 0 new
Last post
Last seen: 7 months 2 weeks ago
Joined: Dec 20 2003 - 10:38
Posts: 249
Overcoming the DATA statement in BASIC

Ok, here's an old question that was asked years ago to the Apple 1 owners club members. I thought I'd answer this question.

How do you rewrite the BASIC program when you are using the DATA and READ command.

Answer: Easy, PEEK & POKE

10 DATA 1,2,3,4,5,6,7,8,9
20 FOR I=1 TO 9

The fix:

In the monitor:

300:01 02 03 04 05 06 07 08 09


10 Z=0:FOR I=1 TO 9
20 A(I)=PEEK(768+Z):Z=Z+1:NEXT I

You could even eliminate the Z and use I but I wanted to point out the easier way to show.

Hope this helps people converting BASIC programs.


iceandfire's picture
Last seen: 6 years 11 months ago
Joined: Dec 20 2003 - 10:38
Posts: 67
Data Statement

Boy that answer took a long time getting to me. About 28 years! I wrote that question for the Apple I Owners Club newsletter back in 1978, and this is the first time I've seen the correct response to it. Vince is the winner. The only prize, though is a harty handshake and an attaboy!:-)


Log in or register to post comments