The "One Error GoTo <label>" part of your VB6 error handling can be converted
automatically to .NET exception handling (download the demo of Clear VB on
our web site to see how).
The stuff that can't be converted easily includes 'On Error Resume Next'
statements. You need to enclose each statement in a try/catch block ("Try"
before the statement, and an empty "Catch" block after the statement). So,
unless your On Error Resume Next is only in effect for a single line or two,
this approach becomes impractical. This code needs to be reworked.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter & VB to C++ converter
Instant J#: VB to J# converter
"DavideR" wrote:
I have converted a large vb6 program with an add-in that for every routine
gimme
the error handling:
the add-in adds one line on the head of the routine
"if myerrhandle then ON ERROR GOTO HERRHANDLER"
and the herrhandler label at the botton where i write in a logfile the name
of the routine, the errors and other information
Well setting myerrhandle to true seems that the error handling keeps on
working in
.net is it right? what's the difference from exception handling?
if exception handling is better like i think how can i do to pass from
errhandling to excection handling?
Some times i use on error resume next has got
handling exception an equivalent?
Thasnks
Best Regards
DavideR