Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access / Assign and AddProperty methods
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Access / Assign and AddProperty methods
Miscellaneous
Thread ID:
00170142
Message ID:
00170142
Views:
57
About VFP 6 Access and Assign methods and AddProperty there are two often stated positions: John K. says they are his favorite improvements while Jim B. keeps preaching restraint.

At long last I have the time to do some experimenting: I must confess that I had developed a big curiosity about the above mentioned methods. While driving to work or walking the dog I was fantasizing all sorts of clever uses and programming tricks: so far I have found only one!. (It's an early stage yet)

In my framework, that is handled mainly through a small collection wizards and builders, many controls have an AssociatedControl property. In VFP5 I had a method called SetInvisible(): when I had to hide a control I would call this method, instead of directly setting the property, and the method would also hide the associated label. I suppose I could use a Visible_Assign method to do this. I am not at all sure yet: being a behavior that is part of the framework it seems to make sense to take this approach but then, a framework is used in many different situations. How would I handle the exceptions? In an easy an intuitive way, that is?. I don't think I would be doing anybody a service if I started to modify the basic functionality of the language: just imagine the chaos it would create having to double-check long ingrained programming habits and knowledge. I think I will stick to my old system, after all.

As for AddProperty, other than using it for creating public vars while my oo conscience is blackmailed into silence, I still have to find how to use it. It seems to me that if I need to add an undocumented property at runtime I am already into the patching part of our job. If a property is that important, I should have added it from the beginning, otherwise, if it's needed because the original specs for the program have changed, it certainly warrants documenting.

To be or not to be. Please, help a doubting soul. Can anybody explain a situation when the use of any of these methods is better than not using them?

TIA
Next
Reply
Map
View

Click here to load this message in the networking platform