General information
Category:
Forms & Form designer
>In some place in my framework, I do DO FORM myform NAME myvariable resulting in a myvariable becoming a type Object.
>
>When the form is close, myvariable is still an Object. Should I modify my baseform to release the object or there is an automatic way of having this behavior when a form is close?
This is happening because a variable of type object is in fact a pointer to the object (e.g. a memory address). When the variable is created, it has the type "O". (My explanation: FoxPro keeps a list of variables with type for each of them. I don't know if this is the truth.). When the object is released, the variable has the value .NULL., but the type is still "O". Looks like a bug, but is not. Because the value was a memory address of an object, the type was "O". When the object is released, the value of the variable is changed, but the type is the same. I find normal this behavior.
The solution: test your variable with ISNULL() function. If it returns .t., your object doesn't exist anymore.
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