It's more than that:
On Error Resume Next
Statement1
Statement2
Statement3
Translates to
try { Statement1; } catch {}
try { Statement2; } catch {}
try { Statement3; } catch {}
There are very few situations where On Error Resume Next is appropriate. I
use it primarily when I'm configuring the run time environment and some of
the configuration has already been done. Rather than test each
configuration item, I simply don't care if the item is already configured
and reconfiguring it throws an error. That said, you definitely have to
keep the On Error Resume Next modules in VB short and to the point.
C# doesn't have a direct equivalent to "On Error Resume Next".
Mike Ober.
"Tony Gravagno" <g6***********@sneakemail.com.invalidwrote in message
news:j0********************************@4ax.com...
Jon Skeet [C# MVP] wrote:
>>Tony Gravagno wrote:
>>On Error Resume Next can easily be implemented as:
try { foo; } finally {}
>>I'm not a VB programmer, but that doesn't sound like it's the same
thing at all. If foo throws an exception, then the above code will
effectively rethrow the exception - it *won't* resume execution on the
next line, which I *thought* was the behaviour of On Error Resume Next.
As I understand it, On Error Resume Next is closer to:
try { foo; } catch {}
Yup yup, I was looking at the comments on Finally and should have
typed Catch. Duh, sorry.