Page 1 of 1
Can't get out of "error" mode?
Posted: Fri Mar 19, 2021 3:22 pm
by TwoCatsYelling
Hello,
So, I'm experimenting with the different things I'm learning in PB and I've run into a problem.
I ran some code with an error in it. The problem line is highlighted in Red and I can see the error on the bottom. However, it won't let me continue editing. I keep getting an error sound, and I don't see any way to get out of it. I had to quit the editor and re-open it. This has happened a couple times now.
Is this a bug? Or is there some button or command I should be using that isn't clearly indicated in the UI?
Re: Can't get out of "error" mode?
Posted: Fri Mar 19, 2021 3:27 pm
by spikey
No. The program is still running but suspended by the debugger when an error occurs. This is so that you can use the debugging tools to investigate a problem when necessary, for example the memory state. This information would be lost when the program ends finally.
Click the "Kill Program" button (the big red X on the toolbar), to kill the program and go back to edit mode.
See
https://www.purebasic.com/documentation ... ugger.html
Oh - I should also mention you can change this behaviour in Preferences - Debugger if you don't like it.
See
https://www.purebasic.com/documentation ... ences.html
Re: Can't get out of "error" mode?
Posted: Fri Mar 19, 2021 3:44 pm
by TwoCatsYelling
Ahh.. So it's in debugger mode. Okay, didn't know what was going on there.
I'd set the icons to the "monochrome" mode, so there was no red x, else I'd have probably clicked on that.
I'm going to keep the behavior on, at least for now. I'm sure it's going to come in very helpful.
I'm really new at this.. very much in the "I don't know what I don't know" phase. So, please forgive if my questions come off extremely ignorant... It's because I'm still extremely ignorant with all of this :p.
Thanks for the help!
Re: Can't get out of "error" mode?
Posted: Sat Mar 20, 2021 2:00 am
by kenmo
Two tips,
1. You can go to Preferences > General > Shortcuts > Debugger > Kill Program and add a keyboard hotkey (if there isn't one), so you don't have to use the toolbar and mouse. I use Ctrl+K for Kill.
2. If the program halting on error annoys you, you can go to Preferences > Debugger > "Kill Program after an Error" to have it automatically stop so you can edit the code immediately. (But sometimes you DO want to pause the debugger, so you can check variable states and figure out your error!)