Re: [fpc-pascal] Blockread and buffers

2005-03-24 Thread Peter J. Haas
Hi Peter, on 2005-03-24T23:23:30+02:00 Peter wrote: >> The problem, you describe above could be solved relative simple, even >> the solution is more complex. I don't know any details of the >> compiler, but I assume, that internally the compiler use a identical >> structure to manage the parameter

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
I made one wrong statement. It's not "as" that doesn't work. getinterfaceentry works only for interfaces that have guid specified. By default guid is zeroed, and getinterfaceentry just returns first interface in table, which means wrong. Same problem shows in Support too. writing guid like ['{000

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Marcel Martin
Michael Van Canneyt wrote: On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: procedure MyXYZPart.DoReport(aRep: IReportable); begin if (aRep <> nil) then begin if (aRep is ILogged) then (aRep as ILogged).Log(aRep.Report) else aRep.Report end; I see what you want, but if you would do pr

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread memsom
> 1. and what I would like is just a lot cleaner and readable code of > this. > 2. Before you tell how to do something at least test and look your > solution > 2.1. Because queryinterface doesn't work in fpc as it should you always > get first vmt and if you do a queryinterface you don't work with

Re: [fpc-pascal] Blockread and buffers

2005-03-24 Thread Peter Vreman
> Hi Peter, > > on 2005-03-24T12:55:21+02:00 Peter wrote: > >>> I don't know, whether other compiler modes support const and out. >>> If yes, the RTL/FCL/LCL functions should use it. This do mean e.g. > >> For compatibility we can't do this. Delphi also doesn't warn. > > This is not really a good a

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 21:21 +0100, Michael Van Canneyt wrote: > OK, now I see where you're going. > > Your last sentence means: I want DoReport to accept only an 'IReportable' > But at the same time, your code is checking that behind 'IReportable' > there is also an 'ILogged'. > > I find this a

Re: [fpc-pascal] Blockread and buffers

2005-03-24 Thread Michael Van Canneyt
On Thu, 24 Mar 2005, Peter J. Haas wrote: > Hi Peter, > > on 2005-03-24T12:55:21+02:00 Peter wrote: > > >> I don't know, whether other compiler modes support const and out. > >> If yes, the RTL/FCL/LCL functions should use it. This do mean e.g. > > > For compatibility we can't do this. Delphi al

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Michael Van Canneyt
On Thu, 24 Mar 2005, ml wrote: [Cut] > > > > > > procedure MyXYZPart.DoReport(aRep: IReportable); > > > begin > > > if (aRep <> nil) then begin > > >if (aRep is ILogged) then > > > (aRep as ILogged).Log(aRep.Report) > > >else > > > aRep.Report > > > end; > > > > I see what you

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 15:01 +0100, Michael Van Canneyt wrote: > > On Thu, 24 Mar 2005, ml wrote: > > > On Thu, 2005-03-24 at 09:06 +0100, Michael Van Canneyt wrote: > >> > >> On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: > >> > >>> Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: > >>> > > >>

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 14:37 +, memsom wrote: > Sorry to be late in the conversation... > > >> Here is a simple example how it should be used > >> > >> type > >> IReportable = interface > >>function Report: string; > >>// let's say that this should write report and > >>// return st

Re: [fpc-pascal] Blockread and buffers

2005-03-24 Thread Peter J. Haas
Hi Peter, on 2005-03-24T12:55:21+02:00 Peter wrote: >> I don't know, whether other compiler modes support const and out. >> If yes, the RTL/FCL/LCL functions should use it. This do mean e.g. > For compatibility we can't do this. Delphi also doesn't warn. This is not really a good argument. FPC

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread memsom
Sorry to be late in the conversation... >> Here is a simple example how it should be used >> >> type >> IReportable = interface >>function Report: string; >>// let's say that this should write report and >>// return status description as string >> end; >> >> ILogged = interface >>

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Michael Van Canneyt
On Thu, 24 Mar 2005, ml wrote: On Thu, 2005-03-24 at 09:06 +0100, Michael Van Canneyt wrote: On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Marco van de Voort <[EMAIL PROTECTED]>: On Tue, 22 Mar 20

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread ml
On Thu, 2005-03-24 at 09:06 +0100, Michael Van Canneyt wrote: > > On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: > > > Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: > > > >> > >> > >> On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: > >> > >>> Quoting Marco van de Voort <[EMAIL PROTECTED]>: > >>> >

Re: [fpc-pascal] Blockread and buffers

2005-03-24 Thread Peter Vreman
> I don't know, whether other compiler modes support const and out. If > yes, the RTL/FCL/LCL functions should use it. This do mean e.g. For compatibility we can't do this. Delphi also doesn't warn. And making the warning dependent on the compiler mode will make things too complex. Because it then

Re: [fpc-pascal] Question about interfaces and patch

2005-03-24 Thread Michael Van Canneyt
On Thu, 24 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Michael Van Canneyt <[EMAIL PROTECTED]>: On Wed, 23 Mar 2005 [EMAIL PROTECTED] wrote: Quoting Marco van de Voort <[EMAIL PROTECTED]>: On Tue, 22 Mar 2005, ml wrote: // than one interface a := (object as IA); // correct b := (object as IB); //