Board index » off-topic » InheritsFrom function

InheritsFrom function


2003-06-25 05:12:22 PM
off-topic13
I could do with a function (like "typeof" compares objects/classes) that
walks the VMTs to find out if an object inherits from a particular class.
Has anyone written such a function? Is it possible?
Thanks - Alan.
 
 

Re:InheritsFrom function

"Alan" < XXXX@XXXXX.COM >wrote in message
Quote
I could do with a function (like "typeof" compares objects/classes) that
walks the VMTs to find out if an object inherits from a particular class.
Has anyone written such a function? Is it possible?

Thanks - Alan.
So, to be clear, whereas the IS operator tests an object for class
inheritance, you're looking for an operator/function that will test a class
for class inheritance without having to declare an object ahead of time?
Until you find what you're looking for, declare a dummy object and use IS
for the test.
Daniel
 

Re:InheritsFrom function

On 25 Jun 2003, "Dan Bragg" < XXXX@XXXXX.COM >wrote:
Quote
Until you find what you're looking for, declare a dummy object and use IS
for the test.
In Turbo Pascal?
--
-Mike (TeamB)
 

{smallsort}

Re:InheritsFrom function

"Alan" < XXXX@XXXXX.COM >wrote in message
Quote
Yes - the "is" operator only works for Delphi.
Entirely my Oops - overe{*word*277}d about the prospect of actually helping
someone rather than being the one requiring help - happens when you read
b.p.d.lang.objectpascal right before this ng... :-)
Daniel
 

Re:InheritsFrom function

"Alan" < XXXX@XXXXX.COM >schreef in bericht
Quote
Thanks for the reply.

I want to do the same that the "is" operator does for you in Delphi,
but
using the "old" objects OWL used.

I hope that makes sense :-)

FWIW did you look at the getclassinfo, classfirst and classnext
functions?