Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hack VCX to add custom properties
Message
From
02/06/2008 10:28:03
 
 
To
02/06/2008 08:32:55
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01319311
Message ID:
01320985
Views:
8
>I've been able to change property values using AddProperty as long as the object already has the property defined in its base class.

Well, that idea didn't come to my mind. I find it actually quite okay, that there is ReadExpression and WriteExpression for properties as analogon to ReadMethod and WriteMethod for methods.

What you can do with writeexpression() for example is something like this:

loXYZ.Addproperty("dToday")
loXYZ.WriteExpression("dToday","=Date()")

Now XYZ will have a property dToday with a value "=Date()". You'll see that same expression in the property window. If you instead do loXYZ.Addproperty("dToday",Date()) you'll set the property to today's date. And that means it will always have a default value of 2nd June 2008, also tomorrow or next year...

That's what's different with WriteExpression. But I encountered the problem, that even if I set a property to some constant text, eg loXYZ.cSoemProperty = "some text", it did not show up in the property window if I modified the class in the class designer. Instead I saw the inherited default value (in my case the class had a parent class).

Bye, Olaf.
Previous
Reply
Map
View

Click here to load this message in the networking platform