Re: [fpc-pascal] interface inheritance implementation

2015-10-13 Thread David Emerson
On 10/12/2015 03:13 AM, Graeme Geldenhuys wrote: t_multiplier_and_adder = class (tbase, i_adder, i_multiplier) Thanks for this recommendation-- the problem is that I have a list whose elements are each i_multiplier_and_adder, and I want to be able to take an element of that list and have the

Re: [fpc-pascal] interface inheritance implementation

2015-10-13 Thread Sven Barth
Am 13.10.2015 08:37 schrieb "David Emerson" : > So far I have not figured out how to typecast an interface into its implementing class, which would be an alternate solution for my particular situation. As long as it's a COM-style interface you can use "intf as classtype". Be

Re: [fpc-pascal] interface inheritance implementation

2015-10-12 Thread Graeme Geldenhuys
On 2015-10-11 20:29, David Emerson wrote: > // and finally the implementing class for i_multiplier_and_adder > t_multiplier_and_adder = class (tbase, i_multiplier_and_adder) I haven't tried this for a while, but vaguely remember the following. As far as I know Interface inheritance does not work

Re: [fpc-pascal] interface inheritance implementation

2015-10-12 Thread Graeme Geldenhuys
On 2015-10-12 16:18, Sven Barth wrote: > Would be nice if you'd find it. I found it, but the point is moot (just like my recent post about Interface documentation bug). It's Blue Monday for me today. :-[

Re: [fpc-pascal] interface inheritance implementation

2015-10-12 Thread Graeme Geldenhuys
On 2015-10-12 14:17, Graeme Geldenhuys wrote: > I the last week or two read a > conversation (can't remember if it was Laz Forums or Google+) where a > Delphi developer did this, but couldn't get that same code to work under > FPC. Scratch that I'll rather try and find the exact article/blog

Re: [fpc-pascal] interface inheritance implementation

2015-10-12 Thread Sven Barth
Am 11.10.2015 21:30 schrieb "David Emerson" : > Do I have to implement all of the individual i_adder methods for t_multiplier_and_adder? Is there no shortcut? AFAIK you can only delegate interfaces that are part of the class' declaration, in your case i_multiplier_and_adder,

Re: [fpc-pascal] interface inheritance implementation

2015-10-12 Thread Graeme Geldenhuys
On 2015-10-12 13:31, Sven Barth wrote: > AFAIK you can only delegate interfaces that are part of the class' > declaration, in your case i_multiplier_and_adder, but not inherited > interfaces, in your case i_adder. That is exactly what I meant when I said "interface inheritance is not fully

Re: [fpc-pascal] interface inheritance implementation

2015-10-12 Thread Graeme Geldenhuys
On 2015-10-11 20:29, David Emerson wrote: > So I would like to use an interface that inherits from another > interface, and ... well rather than describe what I'm trying to do, I > think code speaks best. Attached is a working example, tested under Delphi 7 and FPC 2.6.4. It is slightly

Re: [fpc-pascal] interface inheritance implementation

2015-10-12 Thread Sven Barth
Am 12.10.2015 12:13 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > In FPC you can't inherit one Interface from another. Of course FPC supports interface inheritance. Regards, Sven ___ fpc-pascal maillist -

Re: [fpc-pascal] interface inheritance implementation

2015-10-12 Thread Sven Barth
Am 12.10.2015 15:44 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2015-10-12 14:17, Graeme Geldenhuys wrote: > > I the last week or two read a > > conversation (can't remember if it was Laz Forums or Google+) where a > > Delphi developer did this, but couldn't get that same

Re: [fpc-pascal] interface inheritance implementation

2015-10-12 Thread wkitty42
On 10/12/2015 12:06 PM, Graeme Geldenhuys wrote: On 2015-10-12 16:18, Sven Barth wrote: Would be nice if you'd find it. I found it, but the point is moot (just like my recent post about Interface documentation bug). It's Blue Monday for me today. :-[ [...] I got a bit confused regarding the

[fpc-pascal] interface inheritance implementation

2015-10-11 Thread David Emerson
Not sure what subject line to use to summarize what I'm trying to do here, but that is kind of related :) So I would like to use an interface that inherits from another interface, and ... well rather than describe what I'm trying to do, I think code speaks best. type // here is the first