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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only