Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vartype: behavior
Message
De
16/09/1998 15:10:44
 
 
À
16/09/1998 14:30:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00136852
Message ID:
00137430
Vues:
27
>>It says VARIABLE. What you are looking for is a PROPERTY that belongs to an OBJECT which does not exist.
>
>The object is an application object. So it does exist. The property is and array that does exist and at times has other elements. But if I check for an array element that holds reference to a form that does not exist --- error. It should return 'U'.


Doesn't that array contain .NULL. for that element if that form does not exist?
I tried:
DIMESION aForms[2]
aForms[1] = CREATEOBJECT('form')
aForms[2] = CREATEOBJECT('form')
aForms[2].Release()

Now aForms contains:
[1] - object reference to first form created: VARTYPE(aForms[1]) is 'O'
[2] - .NULL. : VARTYPE(aForms[2]) is 'X'

Since the element is .NULL. (or 'X'), don't do the VARTYPE on the non-existant property. I agree, it would me much easier to test it all at once.

>
>I think that what Bruce found makes sense, but does it mean that you are checking for "ActiveForm.Something" where "ActiveForm" is the _screen object or that the form you are type checking isn't the "Active" form? And why isn't it in my helpfile :-(
>
>>Check for the object reference first, then check if its property exists. It may be even more correct to use PEMSTSTAUS for that.
>
>Actually, the type() function works just fine, which is why I thought that vartype() would work.
>
>Note: vartype() works if the form was instantiated.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform