Compiler and Running Disagree - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Compiler and Running Disagree (/showthread.php?tid=3126) |
Compiler and Running Disagree - Vespin - 10-15-2024 Hi all! New here, and mostly new to programming. Regarding the following code, the compiler thinks it's fine, but when I run the program it says there's a syntax error on the line that begins with "Read" (line 30). I can't seem to get it to go away. What makes it stranger is that I can use it in an entirely different program and there's no such error. Claude.AI and ChatGPT have been useless trying to figure out how to fix this. And yes, there's a fair amount more code above and below in the BAS file, but it doesn't seem to affect this. And no, this code isn't part of a for, loop, sub, or function. Any help would be greatly appreciated. Using the latest version of QB64P as of a few days ago. Windows. Code: (Select All)
EDIT: As is typical, it seems that I figured it out after asking for help. It seems the number-comments after each DATA line are what did it. RE: Compiler and Running Disagree - Pete - 10-15-2024 You can add comments, just add the colon... Code: (Select All)
Pete RE: Compiler and Running Disagree - bplus - 10-15-2024 @Pete good point, I might use line labels above some lines for Restore or Documentation. RE: Compiler and Running Disagree - SMcNeill - 10-15-2024 https://qb64phoenix.com/forum/showthread.php?tid=3077&pid=28734#pid28734 <-- This explains the issue. It's actually 100% working as intended. RE: Compiler and Running Disagree - Kernelpanic - 10-15-2024 I would write the comments, in this case just numbers, before the DATA lines: One to fifteen. For me, zero would not be a DATA line, because zero is zero, there is nothing, that's why it's called zero. |