+RXB Posted July 22 Share Posted July 22 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. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.