Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection class clarification
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00785502
Message ID:
00785532
Vues:
19
got it. this is a very important tidbit of info that I'm not aware of. I always set variables to NULL to clean up these kinds of objects in VFP7 where I used array collections.

>Its simply explain that when a reference exist, the form still exist.
>
>So, if you create the form directly in the collection, there is only 1 reference to the form.
>If you delete the item in the collection, the reference go away and the form is no longer referenced.
>And if you create a reference to the object before adding it to the collection, you have 2 references; the variable AND the item in the collection.
>You need to release both to clear all references.
>
>
>
>>I'm not sure what this is: form1RefCount. Is this a system variable? How can I test for this. I'm think I'm missing something very simple here.
>>
>>>Hi Ramil,
>>>
>>>loForm1 = CREATEOBJECT("form") && form1RefCount =1
>>>loCol = CREATEOBJECT("collection")
>>>loCol.Add(CREATEOBJECT("form"),'1') && form2RefCount =1
>>>
>>>loCol.Add(loForm1,'2')&& form1RefCount =2
>>>
>>>* path1
>>>? loCol.Remove('2') && form1RefCount = 1
>>>
>>>* path2
>>>loForm1 = NULL && form1RefCount = 1
>>>? loCol.Remove('2') && form1RefCount = 0 then VFP release object
>>>
>>>Fabio
ramil
~~ learning to stand still
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform