[fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Zaher Dirkey
IMyIntf = interface function GetValue: Variant; end; TMyObject=(TList, IMyIntf) end; Can not compile becuase it need to add this functions to TMyObject function QueryInterface(const iid : tguid;out obj) : longint;stdcall; function _AddRef : longint;stdcall; fu

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Michael Van Canneyt
On Thu, 15 Apr 2010, Zaher Dirkey wrote: IMyIntf = interface function GetValue: Variant; end; TMyObject=(TList, IMyIntf) end; Can not compile becuase it need to add this functions to TMyObject function QueryInterface(const iid : tguid;out obj) : longint;stdcall; funct

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Zaher Dirkey
On Thu, Apr 15, 2010 at 11:09 AM, Michael Van Canneyt wrote: > {$INTERFACES CORBA} {$INTERFACES CORBA} It is resolved my problem, Is there any limit to use it (except it is not work in Delphi)? Thank for your replay. -- Zaher Dirkey ___ fpc-pascal m

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Michael Van Canneyt
On Thu, 15 Apr 2010, Zaher Dirkey wrote: On Thu, Apr 15, 2010 at 11:09 AM, Michael Van Canneyt wrote: {$INTERFACES CORBA} {$INTERFACES CORBA} It is resolved my problem, Is there any limit to use it (except it is not work in Delphi)? Not that I know of :-) Michael. _

[fpc-pascal] FPC Object Pascal parser?

2010-04-15 Thread Graeme Geldenhuys
Hi, Does FPC include a "general purpose" object pascal parser we can use in our own projects? Obviously the FPC compiler itself has a parser, but is that a free-standing unit or class we can use in other projects? I know fpdoc needs to parse source code as well, but I don't know if it uses the sam

Re: [fpc-pascal] FPC Object Pascal parser?

2010-04-15 Thread Adriaan van Os
Graeme Geldenhuys wrote: Hi, Does FPC include a "general purpose" object pascal parser we can use in our own projects? Obviously the FPC compiler itself has a parser, but is that a free-standing unit or class we can use in other projects? I know fpdoc needs to parse source code as well, but I do

Re: [fpc-pascal] FPC Object Pascal parser?

2010-04-15 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: > > Does FPC include a "general purpose" object pascal parser we can use > in our own projects? Obviously the FPC compiler itself has a parser, > but is that a free-standing unit or class we can use in other > projects? I know fpdoc needs to parse s

Re: [fpc-pascal] FPC Object Pascal parser?

2010-04-15 Thread Graeme Geldenhuys
On 15 April 2010 12:58, Marco van de Voort wrote: >> projects? I know fpdoc needs to parse source code as well, but I don't >> know if it uses the same parser as the FPC compiler. > > No, it uses fcl-passrc. Perfect, thanks. Now my next question is, how up-to-date is the parser [compared to the F

Re: [fpc-pascal] FPC Object Pascal parser?

2010-04-15 Thread Michael Van Canneyt
On Thu, 15 Apr 2010, Graeme Geldenhuys wrote: On 15 April 2010 12:58, Marco van de Voort wrote: projects? I know fpdoc needs to parse source code as well, but I don't know if it uses the same parser as the FPC compiler. No, it uses fcl-passrc. Perfect, thanks. Now my next question is, ho

Re: [fpc-pascal] FPC Object Pascal parser?

2010-04-15 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: > > > > No, it uses fcl-passrc. > > Perfect, thanks. Now my next question is, how up-to-date is the parser > [compared to the FPC parser]? Looking at the repository history for > the fcl-passrc directory, it looks like things are being updated. > Fe

Re: [fpc-pascal] FPC Object Pascal parser?

2010-04-15 Thread Michael Van Canneyt
On Thu, 15 Apr 2010, Marco van de Voort wrote: In our previous episode, Graeme Geldenhuys said: No, it uses fcl-passrc. Perfect, thanks. Now my next question is, how up-to-date is the parser [compared to the FPC parser]? Looking at the repository history for the fcl-passrc directory, it lo

Re: [fpc-pascal] FPC Object Pascal parser?

2010-04-15 Thread Graeme Geldenhuys
Marco van de Voort het geskryf: > > It roughly works, but there are problematic constructs. IIRC it doesn't > support some of the deprecated options. :-) Isn't that a good thing. After all, something marked as deprecated can be removed at any time. The parser simply promotes the idea of cleaning

Re: [fpc-pascal] FPC Object Pascal parser?

2010-04-15 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: > > > > It roughly works, but there are problematic constructs. IIRC it doesn't > > support some of the deprecated options. > > :-) Isn't that a good thing. After all, something marked as deprecated can > be removed at any time. The parser simply

Re: [fpc-pascal] Initializing a record-type variable to get rid of the false-positive compiler hint

2010-04-15 Thread Bart
> FillByte(oSearchOptions, SizeOf(oSearchOptions), 0); oSearchOptions := []; //It's an empty set Bart ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Initializing a record-type variable to get rid of the false-positive compiler hint

2010-04-15 Thread Bihar Anwar
Thanks Bart, forget my silly comments before, you did it cleverly. - Original Message From: Bart To: FPC-Pascal users discussions Sent: Thu, April 15, 2010 10:02:33 PM Subject: Re: [fpc-pascal] Initializing a record-type variable to get rid of the false-positive compiler hint > Fil

Re[2]: [fpc-pascal] Initializing a record-type variable to get rid of the false-positive compiler hint

2010-04-15 Thread José Mejuto
Hello FPC-Pascal, Thursday, April 15, 2010, 6:43:41 AM, you wrote: BA> Thanks for your reply José, but what is the philosophy behind BA> the solution? and What are the reasons for $PUSH and $POP? Also, I BA> tried to remove the $HINTS directive, and it worked fine without BA> it. Could you explai

Re: Re[2]: [fpc-pascal] Initializing a record-type variable to get rid of the false-positive compiler hint

2010-04-15 Thread Bihar Anwar
Thank you very much Jose, that's a detail explanation. Forget my wrong observation before. - Original Message From: José Mejuto To: FPC-Pascal users discussions Sent: Thu, April 15, 2010 10:11:03 PM Subject: Re[2]: [fpc-pascal] Initializing a record-type variable to get rid of the f

[fpc-pascal] nested procedure as parameter question

2010-04-15 Thread Bruce Bauman
I am porting a large amount of existing Pascal code (MetaWare) to Free Pascal. Unfortunately, this code makes extensive use of nested procedures, and the nested procedures often reference variables in the enclosing scope. I know that I can't pass the nested routine by address to another procedure;

Re: [fpc-pascal] nested procedure as parameter question

2010-04-15 Thread Flávio Etrusco
On Thu, Apr 15, 2010 at 2:51 PM, Bruce Bauman wrote: > I am porting a large amount of existing Pascal code (MetaWare) to Free > Pascal. Unfortunately, this code makes extensive use of nested > procedures, and the nested procedures often reference variables in the > enclosing scope. > > I know that

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Marc Weustink
Zaher Dirkey wrote: On Thu, Apr 15, 2010 at 11:09 AM, Michael Van Canneyt wrote: {$INTERFACES CORBA} {$INTERFACES CORBA} It is resolved my problem, Is there any limit to use it (except it is not work in Delphi)? You cannot use casts like var a: IMyObject; b: IMyOtherObject; begin b :

RE: [fpc-pascal] nested procedure as parameter question

2010-04-15 Thread Bruce Bauman
I did try it, and I got the same error message from the compiler. However, I can't be sure if the compiler didn't allow inlining for some other reason. BTW, it would be nice if there were some equivalent to gcc's pragma inline_only(?) which says that the procedure MUST be inlined (or an error is

[fpc-pascal] Published -> Public

2010-04-15 Thread José Mejuto
Hello FPC-Pascal, If I have a class like: TMyClassPublished=class(TObject) published procedure MyProcedure; virtual; end; And a derived one: TMyClassDerived=class(TMyClassPublished) public procedure MyProcedure; override; end; Is there any difference in the derived one with less visibility

Re: [fpc-pascal] Published -> Public

2010-04-15 Thread Marc Weustink
José Mejuto wrote: Hello FPC-Pascal, If I have a class like: TMyClassPublished=class(TObject) published procedure MyProcedure; virtual; end; And a derived one: TMyClassDerived=class(TMyClassPublished) public procedure MyProcedure; override; end; Is there any difference in the derived one

Re[2]: [fpc-pascal] Published -> Public

2010-04-15 Thread José Mejuto
Hello FPC-Pascal, Thursday, April 15, 2010, 11:57:01 PM, you wrote: >> TMyClassPublished=class(TObject) >> published >> procedure MyProcedure; virtual; >> end; >> And a derived one: >> TMyClassDerived=class(TMyClassPublished) >> public >> procedure MyProcedure; override; >> end; >> Is there a

Re: Re[2]: [fpc-pascal] Published -> Public

2010-04-15 Thread Zaher Dirkey
What useful for put procedure in Publish? On Fri, Apr 16, 2010 at 12:06 AM, José Mejuto wrote: > Hello FPC-Pascal, > > Thursday, April 15, 2010, 11:57:01 PM, you wrote: > >>> TMyClassPublished=class(TObject) >>> published >>>   procedure MyProcedure; virtual; >>> end; >>> And a derived one: >>> T

Re: [fpc-pascal] Implementing an interface force me to add _AddRef, _Release

2010-04-15 Thread Graeme Geldenhuys
Marc Weustink het geskryf: > You cannot use casts like > var >a: IMyObject; >b: IMyOtherObject; > begin >b := a as IMyOtherObject; > > or functions like supports() (which uses queryinterface) I remember reading something about this a year or two ago in the mailing list. As far as I re