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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Public Sub WriteLog(Optional ByVal Exception As Exception)

Status
Not open for further replies.

davida37

IS-IT--Management
May 10, 2006
113
GB
Hello,

I have a sub which I need to be able to pass an exception.
Public Sub WriteLog(Optional ByVal Exception As Exception)

This Exception needs to be an optional input parameter. Optional parameters require a defualt value. If this is where I am having the problem.

I do not know how to give a default value for a Exception. If it was a string I would put:

Public Sub WriteLog(Optional ByVal Message As String = "")


Please help.

thanks
david

 
You could try Nothing

Code:
Public Sub WriteLog(Optional ByVal Exception As Exception = Nothing)


Hope this helps.


[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top