- Jun 16, 2004
- 1,034
- 0
- 0
If I create a new class, there doesn't seem to be any easy way to get all of the instances of that class (say, for instance, in a collection).
I've tried to think of a few things, but the best I can come up with is this. Can someone let me know if there's a better way?
Solution (for the moment):
whenever an instance of the class is created in the main program, add it to a publicaly declared collection:
public collection as new microsoft.visualbasic.collection
dim inst as new widget
collection.add(inst)
However, this seems to have a downside, in that the collection doesn't reside within the definition of the class itself. Is there a nicer way to do this? it seems as if there should be...
Thanks again,
I've tried to think of a few things, but the best I can come up with is this. Can someone let me know if there's a better way?
Solution (for the moment):
whenever an instance of the class is created in the main program, add it to a publicaly declared collection:
public collection as new microsoft.visualbasic.collection
dim inst as new widget
collection.add(inst)
However, this seems to have a downside, in that the collection doesn't reside within the definition of the class itself. Is there a nicer way to do this? it seems as if there should be...
Thanks again,