Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can a function return it's parent?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00543844
Message ID:
00543867
Vues:
18
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform