Hi Erik,
>But then again, you shouldn't ever have to. If you find yourself needing a way to do this, you might want to look at your design again.
There is one case I've come across where knowing if there's any code in a method is important: in a Chain of Responsibility error handling scheme. I typically call This.Parent.Error() in the Error method of an object (after determining if the object has a parent, of course) so error handling escalates through the containership hierarchy. One problem: if an object is sitting on a base class page in a pageframe (or in a base class column of a grid, etc.), then unless you hand-coded the Error method of the page, there's no error handling code there and the chain breaks. So, I've used PEMSTATUS() to determine if the method I'm about to call is overridden (ie. is there any code in it). The help docs say this only works for properties, but it does work for methods, with the caveat that it only works if the EXE is built with "debug info" turned on.
OK, so this is obviously a kludge &;t;g>.
Doug
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement