Create collection of UDT 
Author Message
 Create collection of UDT

I have created an User defined data-type like this:

 public type TestType
     text as string
     number as long
 end type

 When I do this:

 dim coll as new collection
 dim test as testtype

 test.text="Hello"
 text.number=86354
 coll.add test

 The last line generates the following error: ByRef argument type mismatch.
 The helpfile says that it's possible to use UDT. How????

TIA!
 Jacco



Fri, 09 Nov 2001 03:00:00 GMT  
 Create collection of UDT
Jacco,

In VB5 it definitely is NOT possible to add a variable dimensioned as a UDT
to a collection, regardless of what the documentation says.  I don't think
its possible in VB6 either, but I have not tried it under VB6, so I could
be wrong.

Hope this helps,

Kerry Moorman



Quote:
> I have created an User defined data-type like this:

>  public type TestType
>      text as string
>      number as long
>  end type

>  When I do this:

>  dim coll as new collection
>  dim test as testtype

>  test.text="Hello"
>  text.number=86354
>  coll.add test

>  The last line generates the following error: ByRef argument type
mismatch.
>  The helpfile says that it's possible to use UDT. How????

> TIA!
>  Jacco




Fri, 09 Nov 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. type/collection/udt

2. Passing UDT to a collection

3. Sending a UDT OR Collections/Classes through Winsock

4. Passing UDT to collection headaches

5. collections with UDT

6. Problem adding UDT to Collection

7. Collection objs and UDT

8. storing UDT's in collection - can u ?

9. collection of udt

10. UDT and collection

11. Collection of UDT type variables

12. How to return UDT's in a collection from a function

 

 
Powered by phpBB® Forum Software