storing UDT's in collection - can u ? 
Author Message
 storing UDT's in collection - can u ?

Nope

Niels

Quote:

>can u do this ?



Sun, 03 Dec 2000 03:00:00 GMT  
 storing UDT's in collection - can u ?

It would be nice if you could, but a collection can only hold
references to other objects (forms or classes).

Make a class with public variables (ie. properties) the same as your
UDT, and add instances of the class to the collection.

If you have arrays or constants in the UDT, you will have to write
property Get/Lets for them (which will slow it down), as they aren't
allowed as public members.

Steve.



Tue, 05 Dec 2000 03:00:00 GMT  
 storing UDT's in collection - can u ?

Erm, you can actually store an array in a Variant, which IS allowed to be
passed back and forth across object boundaries - but not as a POINTER (in
this context) - it gets copied around

in your class ....
Public property Let MyArrayProperty(Byval vMyNewData as Variant)

elsewhere ....
Dim vMyData as Variant
Redim vMyData(0 to 1, 0 to 5)
<do work> .....

and eventually ...
MyObject.MyArrayProperty = vMyData

--
Peter
Peter AT qvsoftware DOT demon DOT co DOT uk
(Anti-spam, go figure)



Wed, 06 Dec 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

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

2. 'Canned' data in VB program

3. Storing a collection in a collection

4. type/collection/udt

5. Passing UDT to a collection

6. Sending a UDT OR Collections/Classes through Winsock

7. Passing UDT to collection headaches

8. Create collection of UDT

9. collections with UDT

10. Problem adding UDT to Collection

11. Collection objs and UDT

12. collection of udt

 

 
Powered by phpBB® Forum Software