In VB6 error handling, if I added the code Resume Next in an error handler, the app would jump to the line of code directly following the offending line - thereby offering a very fast way to find the offending code.
use a variable as help
something as iwashere=“step 1” iwashere=“step 2” iwashere=“step 3”
and at catch you use system.debug(iwashere)
at vb6 i used conditional compilation so this “on error goto …” was bypassed at my wish and the debugger hold at this problematic row.
i think you can do something similar at xojo too.
The on error resume next thing was one of the many things I never understood in VB Why would one ignore an error and execute the following, related, lines anyway?
If you get an exception, you handle it outside of the block (or you exit the current method), but you don’t just ignore the problem and continue dealing with lines that then become problematic, seems nonsense to me
[quote=492562:@Arnaud Nicolet]The on error resume next thing was one of the many things I never understood in VB Why would one ignore an error and execute the following, related, lines anyway?
If you get an exception, you handle it outside of the block (or you exit the current method), but you don’t just ignore the problem and continue dealing with lines that then become problematic, seems nonsense to me [/quote]
all this stupid ms methods raise a error for everything. its more a on error shut up
if not your app will break at run time without a good reason.
most of the ms methods i wrapped in own methods which just return a true / false for execution.
as example if you add a key value to a collection and the key already exist you get a error but as developer it was the intention
not having double keys in this list and the origin list had it.
general resume next is risky if people not know what they do.
nobody will use error handling for each single command. methods respectively the app should be stable as possible.
ms methods not differentiate good between errors and warnings.
[quote=492568:@Markus Rauch]all this stupid ms methods raise a error for everything. its more a on error shut up
if not your app will break at run time without a good reason.
most of the ms methods i wrapped in own methods which just return a true / false for execution.
as example if you add a key value to a collection and the key already exist you get a error but as developer it was the intention
not having double keys in this list and the origin list had it.
general resume next is risky if people not know what they do.
nobody will use error handling for each single command. methods respectively the app should be stable as possible.
ms methods not differentiate good between errors and warnings.[/quote]
Agreed.
“on error resume next” is for wannabees who didn’t know anything about programming. VBA still doesn’t have any error handling so making nice errors was really hard.