[fpc-pascal]Any way to find out ancestry of object? (at runtime)
jonas at zeus.rug.ac.be
Wed Jun 20 15:17:54 CEST 2001
On woensdag, juni 20, 2001, at 03:05 , Marcel van der Heide wrote:
> I would like to find out at runtime if an object is a descendant of a
> object. Is there any way to do this? The TypeOf function can be used to
> out if an object _is_ of a certain type but not if an object is a
> of an object.
This is only available for classes (using the inheritsfrom() method),
not for objects.
PS: don't use typeof() on classes, it returns bogus results there. Use
the "is" operator instead for classes. The compiler still needs to be
fixed so it rejects typeof() applied to classes, since it only works on
More information about the fpc-pascal