Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assigning common error handler to existing controls
Message
 
 
To
07/07/1999 17:50:34
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00238565
Message ID:
00238608
Views:
17
David,

FWIW, All of my lowest level classes that are derived from the VFP BaseClasses have this error method:

ObjError( this, nError, cMethod, nLineNo )

The ObjError can then do whatever you want, including passing the error along to another error handler object.

>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?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform