My current vb project will eventually be migrated to VB.NET and am wondering if the current syntax for Error handing in vb will migrate over to VB.NET. Can vb's error handling be written in such a way so that when the migration does occur, I'm not re-writing the code more than necessary.
My current syntax is
Any ideas?
Thanks,
Jim
My current syntax is
Code:
Public Const FAILURE As Long = 1
Public Const SUCCESS As Long = 0
dim lfun as long
lfun = MyFunction()
If lres <> SUCCESS Then
Err.Raise lres
End If
------------------------------
Function MyFunction() As Long
On Error GoTo Errorhandler
ProcExit:
Exit Function
Errorhandler:
MyFunction = FAILURE
Resume ProcExit
End Function
Thanks,
Jim