This doesn’t make any sense. The element of an array and the array itself have to be the same type. You can’t put an integer value into a string array for example.
Two methods with the same name, the Sub using the Assigns keyword.[/quote]
That only works if your method code is in a module. I’m not wanting to create something global in scope here.
Why? It would be the same amount of lines of code as in the getter and setter of a computed property.
I thought it was about accessing an array of objects as property, not a sole object.[/quote]
Yes, you then can never really access the property directly, but instead have to use a method to access the elements.
I’m not sure what this has to do with anything.
From your post it is not clear to me what you want to achieve. Can’t you post what you have already?[/quote]
So when you want to use WeakRefs, the best way to use them is via computed properties. Let’s say I have a property call TheObjects of type MyObject. I make it a computed property. Now I have a backing property called mTheObjects. I set that to type WeakRef.
Now in the Getter for TheObjects I have code such as:
If mTheObjects <> Nil and mTheObjects.Value <> Nil Then
And in the setter, I have:
mTheObjects = New WeakRef(value)
It’s translating that to work with arrays that will take some work I think Greg’s suggestion is the same type of idea I was thinking would be needed. Just a pain to do the work!