Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Access & Assign - Who is using it?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00171712
Message ID:
00171819
Views:
33
>I've used both the new access and assign methods numerous times and found it to be extremely powerful. I'm just curious what others are doing that may be interesting to us all?

Hi Robert,

I got used to having access and assign methods in another language, and was very much looking forward to their advent in VFP. The FoxPro implementation is the most flexible and robust I have ever seen (although there are a few problems -- see Christof Lange's list in a recent thread).

My favorite use involves setting the enabled property.

I am working on a huge form -- 1100 controls, 5 main pages, 14 minor pages, etc -- just to give you an idea. It's actually an application that probably should have been written in VC++ rather than VFP, but that's what the spec called for.

Its an estimation application for a commercial printer designed to be used by people who are not necessarily trained estimators. So it has lots of expert system/AI features.

To make it work for people who do not necessarily know what they are doing, I have to disable all the controls that do not apply to the estimate as it is developed using a foreclosure tree -- that is, when a choice is made, it forecloses options that are not compatible with that choice and the foreclosure is implemented by disabling all of the foreclosed controls.

In VFP3 and 5, I used a SetEnabled() in every object that had an enabled property. Its been a part of my abstract object collection since day one. The method contains the conditions upon which the control could be enabled/disabled and sets the property accordingly, and changes any appearance properties affected by the change. The only way to do it, however, was with lists (often long lists) of controls or using the controls[] collection, and it was fairly slow in some instances when many objects were being set at once.

By putting the conditional code in an _assign, I can now just

.setall("enabled",[.T./.F.])

and VFP6 automatically applies the conditions to set the control enabled or disabled.

Sweet! And fast.

regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Previous
Reply
Map
View

Click here to load this message in the networking platform