TemplarXB Posted September 9, 2021 Share Posted September 9, 2021 Can Atari BASIC READ DATA statements into a 2-Dimensional Array? 10 DIM A(5,5) 20 FOR B = 1 to 5 30 FOR C = 1 to 5 40 READ A(B,C) 50 NEXT C 60 NEXT B 70 DATA 1,2,0,4,3... etc It gives me an error message on the ( in line 40 Quote Link to comment Share on other sites More sharing options...
+David_P Posted September 9, 2021 Share Posted September 9, 2021 In Atari BASIC, as I recall, you can't READ directly into an array. Try 40 READ X 45 A(B,C)=X Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 10, 2021 Share Posted September 10, 2021 Have you tried loops of 0 to 4? Quote Link to comment Share on other sites More sharing options...
TemplarXB Posted September 10, 2021 Author Share Posted September 10, 2021 David_P - That worked perfectly! Wrathchild - I had tried that earlier and got the same error. I was resorting to manually assigning variable values to each of the array locations. David_P's way works the way I was trying to build the table. Thank you both for the help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.