Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting object reference via indirection?
Message
 
À
28/07/2016 08:14:25
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Divers
Thread ID:
01638766
Message ID:
01638862
Vues:
54
>>
>>
>>IF TYPE("THISFORM.Label" + TRANSFORM(lnLoop)) = "O"
>>
>
>Not good enough, it may be a null of type "O". My preferred test is
>
>if type("thisform.objBlaBla.name")="C"
>
>Any control will have a name, so if it doesn't, it's either not instantiated or it's not instantiated yet or it was set to something else. Either way, if its name is not a string, then it's as good as nonexistent. If it has a name and it's a string, I can safely assume it's a regular object that I can address.

Except empty, the test will fail for it, unless you always add a name property to it.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform