I have a class module that manages an array for me, and every so often I would like to resize the array. Sometimes I want to preserve the array, sometimes I just want to wipe it clean. I am having trouble making the call. The first line of code is the call, the second is the Sub as it is in the class module. I am recieving the following error:
Compile error:
Expected Function or variable
I really dont like the syntax VB is forcing me to use for the call. I want to be able to make the call like this:
Any suggestions?
-JTBorton
Another Day, Another Disaster
Compile error:
Expected Function or variable
Code:
List.ReSize_List(Count) = False
Code:
Public Sub ReSize_List(UpperBound As Integer, Optional blnPreserve As Boolean = True)
If UpperBound > 0 Then
If blnPreserve = True Then
ReDim Preserve List(UpperBound)
Else
ReDim List(UpperBound)
End If
End If
End Sub
I really dont like the syntax VB is forcing me to use for the call. I want to be able to make the call like this:
Code:
[COLOR=green]'To wipe the list clean[/color]
List.ReSize_List(UpperBound:=Count, blnPreserve:=False)
[COLOR=green]'To resize but preserve data[/color]
List.ReSize_List(UpperBound:=Count, blnPreserve:=False)
Any suggestions?
-JTBorton
Another Day, Another Disaster