The following warnings occurred:
Warning [2] Undefined array key "bas" - Line: 4649 - File: inc/functions.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/functions.php 4649 errorHandler->error_callback
/inc/functions_post.php 1034 get_attachment_icon
/inc/functions_post.php 856 get_post_attachments
/showthread.php 1122 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 4649 - File: inc/functions.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/inc/functions.php 4649 errorHandler->error_callback
/inc/functions_post.php 1034 get_attachment_icon
/inc/functions_post.php 856 get_post_attachments
/showthread.php 1122 build_postbit




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)