Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create a Custom Class Programmatically?
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00247522
Message ID:
00247628
Views:
21
>>>Is there any way to use structured programming commands within a class definition?
>>>
>>>What I'd like to do is something like:
>>>
>>>********************
>>>LOCAL liPropertyCount, lcPropertyName
>>>
>>>DEFINE CLASS SARTest AS Custom
>>> FOR liPropertyCount = 1 TO 5 STEP 1
>>> lcPropertyName = "nProperty" + LTRIM(STR(liPropertyCount))
>>>
>>> &lcPropertyName = 0
>>>
>>> ENDFOR
>>>
>>>ENDDEFINE
>>>***********************
>>>
>>>but, of course, VFP5 complains on the FOR line.
>>>
>>>Any ideas, anyone?
>>
>>VFP6 allows you to add properties programmatically at runtime. It's not an option for VFP5.
>
>Ummmm.... didn't KenX have some cool thing for this over at ClassX.com?

Again, it's possible - my own approach to the problem was when I had a class where I new I needed to add properties at runtime, I'd include an array property and size it to fit. Awkward, but natively supported.
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
Previous
Reply
Map
View

Click here to load this message in the networking platform