Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DO FORM NAME question
Message
From
02/02/1997 19:32:18
 
 
To
02/02/1997 17:38:22
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00019076
Message ID:
00019082
Views:
32
>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
Map
View

Click here to load this message in the networking platform