IDE - just a thought on Next and Out of Subscript
#18
(05-15-2023, 12:36 PM)Dimster Wrote: Hi mnrv .. Hot Keys look interesting. I gather an autohotkey program would need to be running at the same time as the EXE is being built. Once the EXE hits the 'out of range' error the EXE should stop and give the option to end execution or continue. If I select end execution then the autohotkey program would grab the line number where execution stopped, reload the IDE and position the IDE cursor at the offending line??? Is that basically how a Hot Key program would work??

I think I may have a fundamental misunderstanding of the dance between the IDE and the EXE. I thought there HAS to be a point where the EXE builds itself from the coding in the IDE. I'm calling this shadowing. In the course of this shadowing, not only does the EXE pick up the syntax but also the line numbers. Where the IDE can monitor the syntax errors it can't know runtime errors. Those can only be detected by the EXE when running the program. As soon as the EXE hits the 'out of range' error, by the very fact it gives an option to end execution or continue, I thought ... as long as the IDE code was available, and the line number with the error identified, then electing to end execution could reposition the cursor at the offending line. 

I've learnt something here. Any connection between the IDE and the EXE only takes place during the shadowing process or whatever you call the process where the EXE is being built from the IDE code. I would need to write code in the IDE that traps all runtime errors and identifies the error line number and then a GOTO that line. I can hear b+'s and Kernelpanic's "told you so". I have used Error trapping code before but always when I knew or expected what the error was likely to be so could watch for that particular error situation. Here I'd want to trap ALL runtime errors, identify the errorline and goto that errorline. Seems very easy to do.

Think of it in terms of going to your sink and pouring a glass of water.  You can turn the faucet and make water come out from the sink, but there's no "reverse" installed so you can pump any back down and into your well, if you decide you don't need it.  

The IDE works in this same, one-way manner -- it takes your BAS code and compiles it into an EXE which then runs independently.  There's no way to then take that EXE and decompile it back down into the BAS source.  All the IDE does is compile the program into a working EXE.  After that, the two are independent processes and one  has no bearing on the other.  There's just no way that an error generated at run-time is ever going to be caught or interacted with, with the IDE itself.  

You might pour oil into the engine of your car, but you sure aren't going to pump it back out from that same hole!  Wink
Reply


Messages In This Thread
RE: IDE - just a thought on Next and Out of Subscript - by SMcNeill - 05-15-2023, 02:05 PM



Users browsing this thread: 6 Guest(s)