Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Testing for the presence of an object
Message
 
À
24/05/2001 21:02:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00511250
Message ID:
00511297
Vues:
17
>>How do you test for the presence of an active object?
>>
>>thanks, Randy
>
>one way us vartype() function.
>
>vartype(oApp) returns 'O' if oApp exists as an object, 'U' or 'X' if it doesn't. Look up in help to see possible return values...

Not exactly. VARTYPE(oApp) or TYPE("oApp") will still return "O" if oApp was NULLified and does not exist anymore. It is better to add the check AND !ISNULL(oApp), or check for TYPE("oApp.Name") = "C" (excluding the objects which created with SCATTER NAME command - they don't have native .Name property.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform