Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement