General information
Category:
Coding, syntax & commands
>>>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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only