05-14-2023, 08:53 PM
(05-14-2023, 07:29 PM)Dimster Wrote:Quote:Remember, when you run the EXE, you're running the compiled program which executes independent of the IDE. A subscript error only happens at run time, and there's no real way for the IDE to interact with your program itself at that point. The easiest solution in this case is simply to write down or remember the line number and then CTRL-G and type in that number to instantly go to that line. (Or use the main menu and Search>Goto Line #...)
Hi Steve - So the EXE is running and picks up an out of range error. The program stops running and you get a choice of Continuing or not. The line number is already identified. If I chose Continue, I'm assuming the program starts running again after the line the EXE has just informed me where the error is. Why is it, if I chose NOT to continue, the cursor not on or near the line which caused the error.
This is because your EXE is completely independent of QB64 and the IDE once it's compiled. Write a program sometime and then copy it onto a computer without any version of QB64 on it whatsoever. It'll compile as there's no errors in the code itself, so you can make a valid EXE, and you don't need QB64 anywhere around to run that EXE after its compiled.
If the EXE tells you "Out of Range on Line 12345", and you don't have QB64 installed on that PC, how's it going to load *anything* into the IDE? Even IF you do have a copy of QB64 somewhere on your computer, how's it going to load the BAS file to jump to that line? Lots of folks distribute EXEs without the source being attached anywhere with it.
When the EXE encounters an error, it basically gives you all the information that it can -- "You went beyond your defined limits on line XYZ..." The EXE doesn't have the BAS file embeded with it, it doesn't automatically have a copy of QB64 attached to it, and it isn't going to load its source into any editor for you automatically.
The languages that tend to allow such interactions are more likely to be interpreters rather than compilers, and at the end of the day, QB64 is nothing more than a compiler at work.