Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can a function return it's parent?
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00543844
Message ID:
00543867
Views:
11
>I have an object that I built an error handler and logger for. In that object, I call a function. If an error occurs in the function it would be nice to call the error handler in my object. Is there a way for a function to determine what object called it?
>
>Or is this just all-around bad programming style?

You mean this object (class) contains this function? And in this class you have put some code in the Error() event to handle and log errors?

If yes then the Error() event for this class will trigger automatically if the function (method) produces an error.

And in addition to the other replies, if the function is contained in another object (class) what you can do is instead of having two objects (classes) have the second class inherit from the class with the error handler (and any class where you want to implement this error event), and in this way it will have this functionality built-in.
HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform