Linuxer Wang wrote:
>
> Hello,
>
> Can anybody tell me how can I know which specific type an instance of
> class is?
Check the ClassType or ClassName.
> The "is" operator seems weird when interface is used.
Add a GetObject method to your interfaces, that returns the object that
implements the
> >Sometimes I added a GetUnderObject() to my interfaces to get the actual
> >object. But it's a choice up to the interface author.
> >BTW I needed it to release the object through the interface.
> >I suspect that if you shouldn't ever need to know the actual class when
> > using interfaces (maybe
Uberto Barbini wrote:
It does not seem right to declare var inst: TMyInterface if you
want inst to have circles and squares as values. I would expect
that you also have a class TFigure, of which TCircle and TSquare
both are descendants. These could also implement TMyInterface.
You then declare va
> It does not seem right to declare var inst: TMyInterface if you
> want inst to have circles and squares as values. I would expect
> that you also have a class TFigure, of which TCircle and TSquare
> both are descendants. These could also implement TMyInterface.
>
> You then declare var inst: TF
On Sun, Apr 17, 2005 at 12:01:36PM -0700, Linuxer Wang wrote:
>
> Can anybody tell me how can I know which specific type an instance of
> class is? The "is" operator seems weird when interface is used.
>
> Suppose TMyInterface is a interface, and classes TCircle and TSquar
> both implements TMyIn
Hello,
Can anybody tell me how can I know which specific type an instance of
class is? The "is" operator seems weird when interface is used.
Suppose TMyInterface is a interface, and classes TCircle and TSquar
both implements TMyInterface, and inst:TMyInterface, inst :=
TCircle.Create. How can I k