Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unexpected token 'NEXT'
#1
Hello,

this is my 1st post! Total newbie.

I just typed in the 1st program in the book "ZX Spectrum Games Code Club: Twenty fun games to code and learn" by Gary Plowman (from Amazon),
but when I attempt a "zxb ex1.bas" , it throws up a couple of errors.
I've checked the code and it appears valid. Any ideas on what the problem could be?

(I've attached the .bas file)

Regards


Attached Files
.bas   ex1.bas (Size: 3 KB / Downloads: 139)
Reply
#2
Yes, the problem (despite this weird error) is not with the FOR, but with the IF.
Unlike Sinclair BASIC, ZX BASIC requires each IF to be closed with an END IF.
So after every IF line, in the end, add :END IF and compile it.

Try it, and tell me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)