Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Brainless display form
Message
From
28/08/2011 06:24:22
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
26/08/2011 13:53:46
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01521847
Message ID:
01522023
Views:
135
>Dragan:
>
>I want the form to be as brainless as possible, so I'll ask my question a little differently:
>
>1. In the calling form there will be an object with a method called 'SetFilter' that has all the code that you described. Depending on the situation, I want to modify the code (can this be done?).
>
>2. I then call the brainless display form:
>
>
>do form with loMyObject
>
>
>3. All the brainless form needs to do is say in the init:
>
>
>lpararameter toObject
>
>toObject.setfilter()
>
>
>The brainless form doesn't care what is in the setfilter method; the calling form took care of that. Can this be done?

Why not. You can even have different objects, all of them with setfilter method, passed for different occasions. As long as nothing in the object says "thisform" or refers to the form itself. Actually, even that can be done, if the form would pass itself as a parameter in .setFilter() call, but that may get you entangled in objects which are too dependent on each other (how fast can you say "impossible maintenance"?).

Actually, if you keep the logic outside of the form, then you don't need the filter as such - you can select into a fresh cursor, filtered any way you like, and just pass the alias to the brainless form.

Someone said once, the main question of OOP is 'where does the code go?'... and was right.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform