Originally posted by Borje Hagsten:
A small question on "ON ERROR RESUME NEXT": I have been under the impression that
using "IF ERR THEN.." after critical parts in code is a bit faster/leaner and even
a bit "safer". Is it just something I have dreamt? I sometimes tend to mix things up.
A small question on "ON ERROR RESUME NEXT": I have been under the impression that
using "IF ERR THEN.." after critical parts in code is a bit faster/leaner and even
a bit "safer". Is it just something I have dreamt? I sometimes tend to mix things up.
Using ON ERROR RESUME NEXT (the default) is perfectly "safe" as long as you carefully write your code to trap all possible errors (or at least the crippling ones!), whereas using ON ERROR GOTO is "guaranteed" to trigger on all runtime errors (except GPF's, etc!).
Really it comes down to coding style (personal preference) and the task at hand, for the choice of which error detection scheme you employ in each sub/function in your code.
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Comment