Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check if Form property exist, then add it if it doesn't
Message
From
22/01/2008 09:47:05
 
 
To
21/01/2008 22:41:51
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01283633
Message ID:
01283990
Views:
15
>>>>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.

Instead of "really" I should have written "usually".
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform