Re: [fpc-pascal] Problem accessing Class Method with abstraction

2010-10-17 Thread patspiper
On 10/17/2010 05:54 AM, Andrew Brunner wrote: I've got a class factory problem I'm trying to resolve and it appears I'm at a point where it's probably better to ask for help. TCoreObjects=class; TCoreObject=Class (TPersistent) protected class procedure VerifyIDs(var Module:TDBMSMod

Re: [fpc-pascal] Problem accessing Class Method with abstraction

2010-10-17 Thread Michael Van Canneyt
On Sat, 16 Oct 2010, Andrew Brunner wrote: I've got a class factory problem I'm trying to resolve and it appears I'm at a point where it's probably better to ask for help. TCoreObjects=class; TCoreObject=Class (TPersistent) protected class procedure VerifyIDs(var Module:TDBMSModule); Vi

[fpc-pascal] TInterfacedObject memory management

2010-10-17 Thread Juha Manninen (gmail)
Hi I have a program that creates a TInterfacedObject and nothing else. program project1; {$mode objfpc}{$H+} uses Classes; var io: TInterfacedObject; begin io := TInterfacedObject.Create; end. I compile it with -gh (heap trace) and get the following output: [DBGTGT] Heap dump by hea

Re: [fpc-pascal] TInterfacedObject memory management

2010-10-17 Thread Marco van de Voort
In our previous episode, Juha Manninen (gmail) said: > I have a program that creates a TInterfacedObject and nothing else. > > program project1; > {$mode objfpc}{$H+} > uses > Classes; > var io: IUnknown; > begin > io := TInterfacedObject.Create; > end. Try the above program. > If

Re: [fpc-pascal] TInterfacedObject memory management

2010-10-17 Thread Paul Ishenin
17.10.2010 21:31, Juha Manninen (gmail) wrote: program project1; {$mode objfpc}{$H+} uses Classes; var io: TInterfacedObject; begin io := TInterfacedObject.Create; end. Try the same but replace io type to IUnknown. Best regards, Paul Ishenin. __

Re: [fpc-pascal] TInterfacedObject memory management

2010-10-17 Thread Juha Manninen (gmail)
On Sunday 17 October 2010 15:01:37 Paul Ishenin wrote: > Try the same but replace io type to IUnknown. Thanks Marco and Paul. I should have known this one. Regards, Juha ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal

Re: [fpc-pascal] Problem accessing Class Method with abstraction

2010-10-17 Thread Andrew Brunner
On Sun, Oct 17, 2010 at 3:33 AM, Michael Van Canneyt wrote: // Revised code CCoreObject=Class(TCoreObject); TCoreObjects=class; TCoreObject=Class (TPersistent)  protected   class procedure VerifyIDs(var Module:TDBMSModule); Virtual; abstract;  end;  TAdminCore=Class(TCoreObject)  protected

Re: [fpc-pascal] Problem accessing Class Method with abstraction

2010-10-17 Thread Andrew Brunner
procedure VerifyIDs(Var Module:TDBMSModule); var iLcv:integer; ItemP:PCoreObjectItem; coGeneric:TPersistentClass; coItem:TCoreObject; begin for iLcv:=0 to High(CoreObjectItems) do begin ItemP:=CoreObjectItems[iLcv]; coGeneric:=GetClass(ItemP^.ClassName); if (coGeneric<>nil) an

Re: [fpc-pascal] Problem accessing Class Method with abstraction

2010-10-17 Thread Andrew Hall
The reason you cannot call VerifyID's from coGeneric is that the compiler sees coGeneric as a TPersistentClass which does not implement the VerifyIDs method. The following changes will give you the desired result... type TCoreObjectClass = class of TCoreObject; If (coGeneric<>nil) and coGe

Re: [fpc-pascal] Can variables be declared within a block?

2010-10-17 Thread Zaher Dirkey
On Thu, Oct 14, 2010 at 11:21 AM, Michael Van Canneyt < mich...@freepascal.org> wrote: > > > On Thu, 14 Oct 2010, Frank Church wrote: > > Can variables be declared within a begin end block? >> > > No. > That found in Gnu Pascal Can we ask to be feature request? Thanks -- Zaher Dirkey _

Re: [fpc-pascal] Can variables be declared within a block?

2010-10-17 Thread Florian Klaempfl
Am 18.10.2010 08:17, schrieb Zaher Dirkey: > > > On Thu, Oct 14, 2010 at 11:21 AM, Michael Van Canneyt > mailto:mich...@freepascal.org>> wrote: > > > > On Thu, 14 Oct 2010, Frank Church wrote: > > Can variables be declared within a begin end block? > > > No. > > > That fou