I've recently started making use of the ability to create custom onerror messages. This is extremely powerful, but.......
If I write a custom onerror routine, is there a way to know what line caused the error? I can get lost trying to fix a problem when it basically gives me the line number of the onerror routine rather than the line number that sent it to the onerror routine.
Any help with this is appreciated.
Dan
ONERROR - What line caused the error?
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Some error messages include the line number, so for those you can look at LASTERROR and it will tell you. Others don't and there's currently no record of what the line was.
We'll definitely improve that in future.
In the mean time, you could enable logging, have your error handler write to the log file. Later you can then look at the log file, find where your error handler has written to it and just above that will be the offending line that caused the error.
We'll definitely improve that in future.
In the mean time, you could enable logging, have your error handler write to the log file. Later you can then look at the log file, find where your error handler has written to it and just above that will be the offending line that caused the error.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?