FAQ  •  Register  •  Login

Unexpected token 'NEXT'

<<

gunduzs

Posts: 1

Joined: Sun May 22, 2016 8:05 pm

Post Mon May 23, 2016 7:09 pm

Unexpected token 'NEXT'

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
Attachments
ex1.bas
ex1.bas
(3 KiB) Downloaded 35 times
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Tue May 31, 2016 4:03 pm

Re: Unexpected token 'NEXT'

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.

Return to Help & Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO