Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Migrating from vb to vb.net

Status
Not open for further replies.

Jimdeb03

IS-IT--Management
Dec 10, 2002
89
US
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
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
Any ideas?
Thanks,
Jim


 
So, can you recommend any changes?
 
You can use try..catch..finally statements. Look them up in the help, there is a lot of information there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top