My main project will occasionally crash for no apparent reason, even when running in the debugger. All the debugger tells me is the program terminated unexpectedly. Maybe OnError could catch it, but don't understand how to use that. The OnError.pb sample code is very informative but I need to know what line is causing the crash.
I found the trick. Have to go into Compiler Options and put a check on "Enable OnError line support".
Now all I have to do is wait for the unexpected error and hope it gets caught instead of just crash.
[SOLVED] Trick to catching errror that causes crash?
-
- Addict
- Posts: 1064
- Joined: Sun Jul 25, 2004 4:21 pm
- Location: USoA
[SOLVED] Trick to catching errror that causes crash?
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Randy
I *never* claimed to be a programmer.
Re: [SOLVED] Trick to catching errror that causes crash?
Just be aware that this is not 100% reliable. I also have it enabled but sometimes my app exits/crashes silently with no trace. I eventually find out it's due to my own coding mistakes, so it's made me a better coder by having to discover the crash on my own when OnError doesn't help.
-
- Addict
- Posts: 1064
- Joined: Sun Jul 25, 2004 4:21 pm
- Location: USoA
Re: [SOLVED] Trick to catching errror that causes crash?
Yeah, I can only hope that one day I will be able to spot the errors in my code. I've been fortunate for the most part up until now. The debugger will usually stop with a line showing fatal error or illegal something or other. Lately it's just been poof and it's gone, even in the debugger.BarryG wrote: Wed Sep 03, 2025 8:32 am ...I eventually find out it's due to my own coding mistakes, so it's made me a better coder by having to discover the crash on my own when OnError doesn't help.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Randy
I *never* claimed to be a programmer.