Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check if Form property exist, then add it if it doesn't
Message
De
21/01/2008 22:41:51
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
21/01/2008 10:20:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01283633
Message ID:
01283896
Vues:
19
>>>Container class. During runtime, I want to check if a property exists on the parent form and add it if it does not. I know I can use AddProperty(), but how to check if it's already there? Thanks!
>>
>>Use PemStatus().
>
>There's really no reason to check, since addproperty() will function anyway.

Unless the value is supposed to be different, i.e. if you're adding a default value post festum.

Assume you want to show some data about a motherboard, and have several fields which didn't exist on ancient motherboards (like number of fans, newer kinds of slots, *ATA drive slots, USB slots... none of that existed in '90, right?). So instead of complicating your display with various checks "if .Property42 is absent, display 'n/a'", you may want to just do it at a lower level, where you build an object to pass to display. And you just check for any such missing properties (build a list of words and just parse it), and add a "n/a" for any missing one, and off you go. Can be done in four lines.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform