Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Neat feature about Collection Class
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00791053
Message ID:
00802906
Views:
27
Thanks for the follow-up. I must say I do not like this inconsistent behavior. I also see this same aberrant behavior if you issue ox=.null. instead. The only way to clear it from the collection at that point is to issue oy.item(1).release()

>Hi Mark,
>
>I know it's been a while since you posted this, but I wanted to add something interesting I discovered while putting together a short demo of collections for the users group.
>
>If you do this:
>
>ox = createobject("Form")
>oy = createobject("Collection")
>oy.Add(ox,"MyForm")
>release ox
>
>You still have an object reference to the form in the oy collection, and can still get at properties and objects in the form. What happens is an additional reference to the form is created when you add it to the oy collection.
>
>I showed this to Mike Stewart, and he started playing around with this some too. If you call the Release method of the form, then it cleans up the collection, however, Mike found a situation where the reference in the collection was null. I'm finding in the above case, if I change the RELEASE ox line to ox.Release(), the item is completely removed from the collection. (Hey Mike, do you remember what you did to get the null?)
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform