Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Run-Time adding properties and accessing w/o knowing nam
Message
De
24/08/1999 07:38:17
 
 
À
23/08/1999 21:53:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00256904
Message ID:
00256966
Vues:
18
>I have started down a path where I read a number of settings from an ini file, popluate them to a custom class and I need to display them in a listbox. I do not know all of the names a head of time. When I read the ini file, I create a property and populate the value. Is there a way of programmically walking through all the properties of a class.
>
>Ideas?

You can use AMEMBERS() to build an array containing of the properties of a class pretty easily; you can add properties to a class at runtime under VFP6 at least using the AddProperty() method of the class.

DIMENSION aPropsB4[1], aPropsAfter[1]
oClass = CREATEOBJ('MyClass')
? AMEMBERS(aPropsB4,oClass)
oClass.AddProperty('Xyzzy')
? AMEMBERS(aPropsAfter,oClass)


>
>One choice is to go back and just populate an array property but that seems too easy. I have to do things the hard way.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform