|
-
Dec 12th, 2005, 05:37 AM
#1
Its not possible to add an UDT to a Collection?
I have a program where I declared a Private Type, then I created an Array of UDTs.
The problem is I can't use ParamArray, its not posible with Arrays of UDT.
I need to pas the array to a Function, I don't want to create another function to do exactly the same, its too much code.
Then I tryied to use a Collection, so I could pass the collection as parameter, but, it seems its not possible to add UDTs to a collection.
This doesn't work:
VB Code:
Private Type myType
ala As Integer
ele As String
End Type
Private mCol As Collection
Private Sub Form_Load()
Dim p As myType
Set mCol = New Collection
mCol.Add p 'Error here
End Sub
I need to put these UDTs inside something, and pass that something to a Function, How could I do that?
I know Objects work well with Collections, but I'm trying to avoid converting this UDT to a CLASS.
-
Dec 12th, 2005, 01:00 PM
#2
Re: Its not possible to add an UDT to a Collection?
You can create a data definition class and add that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|