Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ThisForm.ActiveControl Returns Not An Object
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00510492
Message ID:
00510584
Vues:
15
>Following on Larry's coattails,
>
>>>IF TYPE("ThisForm.ActiveControl.Name") = "C" will return .T. if ActiveControl is a valid object with a Name property. Do not use Vartype() for this as it is not robust enough for the checking and it will throw an error.
>
>The same can be done with variables.>>
>
>
>While
>TYPE("ThisForm.ActiveControl.Name") = "C"
>
>is functionally similar to
>TYPE("ThisForm.ActiveControl") = "O"
>
>testing agains the .Name property of an object is more robust than testing against the object itself. It sure looks weird though.
>
>Regards,
>Thom C.

One exclusion though - the object created with SCATTER NAME command does not have .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