Jump to content

Extended BASIC G.E.M.


Recommended Posts

13 hours ago, senior_falcon said:

I am finally in the home stretch on the XB Game Developer's Package.

One of the side effects that happened when the more complicated XB style IF/THEN/ELSE statements was that a trailing comment in the line would sometimes cause an error in the compiled code.

Interestingly enough, these two lines fail in different ways:

10 IF X=3 THEN Y=7 ! comment

10 IF X=3 THEN Y=7 REM comment

I have no idea why this happens or why they are different, but I put yet another band-aid on the code and it now works properly. Even better, I see no way this will lead to unexpected trouble in the future.

When the interpreter finds ! (explanation point) it has code in the XB ROMs to ignore this token after a program line 

When the interpreter finds REM (REMARK) it is not the same code but branches to part of that code 

This is why you get different results. 

If you put a :: between end of the line and the Y=7 in both lines you will get no errors.


10 IF X=3 THEN Y=7 ::  ! comment

10 IF X=3 THEN Y=7 :: REM comment


I bet if you test this it never gives different results in your compiler.
If you want I can show you the XB ROM code that is causing the problems.


  • Like 1
Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...