-1

I have been coding "duel" from the book "Sixty Programmes for the Commodore 64" (by R. Erskine et al.), into my C64 mini in basic. I keep getting the following error: "? Out of data error in 60". I've checked the code for typos and can't find any. Has anyone else had this problem and do you have a fix? Thank you

I have checked the code for typos and I can't find any.

Lines 5-60:

5 REM *** D U E L ***   @ MICHAEL BEWS
      *** TRANSLATED BY IAN YATES
10 V-53248:X=RND(-TI):POKEV+32,4:POKEV+33,5:POKEV+24,23:POKE650,255:M20
20 Y$="String of C64 Characters":X$="String of C64 Characters
30 PRINT"String of C64 CharactersPLEASE WAIT WHILE USER-DEFINED",,"CHARACTERS ARE SET UP."
40 POKE52,48:POKE56,48:POKE56334,PEEK(56334)AND254:POKE1,PEEK(1)AND251
50 FORX=14336TO15143:POKEX,PEEK(X+40960):NEXT:FORX=1TO30:READA:NEXT
60 FORX=15144To15247:READA:POKEX,A:NEXT:M$="String of C64 Characters":N$="String of C64 Characters"
Jason Aller
  • 3,541
  • 28
  • 38
  • 38
  • 5
    At the *very* least, you will need to post what is on line 60. And almost surely more than that. – Scott Hunter May 30 '19 at 13:08
  • Can you post the data statements or can you verify you really have 133 data statements? most probably you missed a data statement line or a comma between some of the data entries. – wizofwor Jun 24 '19 at 08:09

1 Answers1

3

DATA is a way of feeding a sequence of values into a BASIC program. The number of values in the DATA statements must be greater or equal to the number of times READ is called. If READ runs out of DATA values then it raises an "Out of Data" error.

In this case, there should be 133 values separated by commas or different DATA statements. However, the end of line 50 is somewhat odd. It reads 30 values into A without doing anything with them so that part is pointless.

Check your source for the code to see if there are any misprints or missing lines. If not, try commenting out that line 50 FOR statement.

Mike
  • 2,721
  • 1
  • 15
  • 20
  • Additional: The most common time you'll see an "out of data" error on the C64 is if you hit return on the line where the C64 has said "Ready". This is because "Ready" is interpreted as "Read y" and since immediate mode has no "data" statements, it's out of data. – Mike Jan 05 '20 at 12:53