alfardan
asked on
VB.NET - giving a default value to an Arraylist in a function paraments list
Hi
I have declared a function that returns to me some data, the thing is one of its parameters is an ArrayList and it's an optional parameter. check the code below.
As you see, I said {Optional ByVal Editable As ArrayList = Nothing} and it gives me an error on run time, so I thought the default value I gave to the optional arraylist is wrong, so what shall I put instead of 'Nothing'? I want it to be an arraylist of no data included if the user did not pass anything to that function.
I have declared a function that returns to me some data, the thing is one of its parameters is an ArrayList and it's an optional parameter. check the code below.
As you see, I said {Optional ByVal Editable As ArrayList = Nothing} and it gives me an error on run time, so I thought the default value I gave to the optional arraylist is wrong, so what shall I put instead of 'Nothing'? I want it to be an arraylist of no data included if the user did not pass anything to that function.
Public Shared Function DisplayRequestMainData(ByVal Col1Contents As ArrayList, ByVal Col2Contents As ArrayList, Optional ByVal TableTitle As String = "Request Main Data", Optional ByVal Editable As ArrayList = Nothing) As String
[SOME CODE HERE]
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER