Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assigning common error handler to existing controls
Message
From
07/07/1999 17:50:34
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Assigning common error handler to existing controls
Miscellaneous
Thread ID:
00238565
Message ID:
00238565
Views:
44
OK - Thanks to Jim Booth I finally took the time to begin to learn how to incorporate forms into the old FP code I'm upgrading.

I created a form and it works great. The next thing I'd like to do is create a single Error Processing handler which all of the controls on my form would invoke upon encountering an Error Event.

Since I created the form with the Form Designer using VFP's canned objects, it doesn't seem like I can now go in and specify the default Error Event method which all of the objects inherit from their respective parent classes. Instead, it looks like I must go in and individually program the error event for each control to execute the common error handler method.

Having created this form and its sub-objects, is there now an efficient way to assign all of their Error Event methods to a common method without individually touching each one?

From what I understand of OOP, what I would do if I had access to the baseclasses of these objects is that I would modify the default Error Event method of each baseclass. I would still have to reprogram each baseclass, but at least I'd only have to do it once, since I'd base future objects on the redefined baseclasses.

Continuing this line of reasoning, it seems like the prudent thing to do as a developer would be to create my own set of parent classes, themselves all clones of VFP's canned base classes, but having the ability to be modified by me and thereby automatically passing on their genes aposteriori to any living descendents (ie., subclasses I've already designed and used to create objects in an application). In particular, should I create a form template, itself a copy of the one you get when the Form Designer first fires up; the one difference being that this form template would be based on MyBaseClassForm which itself would be a child of VFP's Form class?

Is building such a set of custom parent classes necessary, or is there some VFP functionality that gives me the same flexibility?
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum
Next
Reply
Map
View

Click here to load this message in the networking platform