Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to free object instances?
Message
De
12/12/1997 22:55:03
 
 
À
12/12/1997 22:42:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00065705
Message ID:
00065709
Vues:
44
>>>Can anyone tell me how i can release a single object instance of a user-defined class from memory?
>>>
>>>i do not want to wait for the object instance to go out of scope or wait for the program to end or to do a CLEAR ALL to achieve this.
>>>
>>>Example: i have an object-reference 'oTest'
>>>oTest = CREATEOBJECT('clsTest')
>>>
>>>Any help will be appreciated!
>>>Many thanks :)
>>>
>>>Mazlan Bin Mohammad
>>
>>oTest=.NULL.
>>
>>:0)
>
>(Beggin everyone's pardon...i know that sleepiness is not an excuse to have asked the question i initially asked)

Don't excuse yourself. This is why UT exists! :)

>i think oTest.Destroy does the job too. Am i rite?

No. Destroy is an event. The right way is the one Gérald gave. Another way to skin the same cat is:

RELEASE oTest

There's a little difference between these 2 methods:
oTest = .NULL. will detroy the object, but the oTest variable still exists and TYPE("oTest") still returns "O". RELEASE oTest destroys the object and the oTest variable. You can use one or the other, depending on your needs.

Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform