Re: [fpc-pascal] How to set a type as a variable?

2010-08-23 Thread Marco van de Voort
In our previous episode, Frank Church said: > I did this kind of thing some time ago, but have forgotten the details. > > Let us say you have something like TBaseType(Variable).Method, you want to > let TBaseType be a variable so you can have some code like this. > > procedure (value:someType) >

Re: [fpc-pascal] make smart doesn't work for cross build

2010-08-23 Thread leledumbo
Oh, is that so? What about defining CREATE_SMART and LINK_SMART? Jonas Maebe-2 wrote: > > > On 21 Aug 2010, at 08:59, leledumbo wrote: > >> I want to build a smartlinked (stripped and optimized as well) version of >> fpc >> for win64 from win32, so I call: >> make all smart STRIP=1 OPTIMIZE=1

Re: [fpc-pascal] make smart doesn't work for cross build

2010-08-23 Thread Jonas Maebe
On 21 Aug 2010, at 08:59, leledumbo wrote: > I want to build a smartlinked (stripped and optimized as well) version of fpc > for win64 from win32, so I call: > make all smart STRIP=1 OPTIMIZE=1 OS_TARGET=win64 CPU_TARGET=x86_64 > > but this ends in failing to call ppcx64. Hey, shouldn't it call

Re: [fpc-pascal] How to set a type as a variable?

2010-08-23 Thread Felipe Monteiro de Carvalho
No, if all your types are classes descending from the same root you can do it is like this: type TBaseType = class; procedure somemethod(); end; TExtendedType = class(TBaseType); TBaseTypeClass = class of TBaseType; procedure (value: TBaseType; type_: TBaseTypeClass) begin value :

Re: [fpc-pascal] How to set a type as a variable?

2010-08-23 Thread leledumbo
Anthony Walter-3 wrote: > > Like so: > > procedure Test; > var > SomeType: TClass; > SomeObject: TObject; > begin > SomeType := TStringList; > SomeObject := SomeType.Create; > (SomeObject as TStrings).Add('Hello World'); > ShowMessage((SomeObject as TStrings)[0]); > SomeObject.Fr

Re: [fpc-pascal] How to set a type as a variable?

2010-08-23 Thread leledumbo
It can be implemented with RTTI or variants perhaps. Anthony Walter-3 wrote: > > Like so: > > procedure Test; > var > SomeType: TClass; > SomeObject: TObject; > begin > SomeType := TStringList; > SomeObject := SomeType.Create; > (SomeObject as TStrings).Add('Hello World'); > ShowMe

Re: [fpc-pascal] make smart doesn't work for cross build

2010-08-23 Thread leledumbo
I see no -CX / -XX appeared in the command line. Florian Klämpfl wrote: > >> So, I try removing smart target. It works! But the binaries aren't >> smartlinked... > > What makes you think so? > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal

Re: [fpc-pascal] How to set a type as a variable?

2010-08-23 Thread Anthony Walter
Like so: procedure Test; var SomeType: TClass; SomeObject: TObject; begin SomeType := TStringList; SomeObject := SomeType.Create; (SomeObject as TStrings).Add('Hello World'); ShowMessage((SomeObject as TStrings)[0]); SomeObject.Free; end; On Mon, Aug 23, 2010 at 7:05 PM, Frank Churc

[fpc-pascal] How to set a type as a variable?

2010-08-23 Thread Frank Church
I did this kind of thing some time ago, but have forgotten the details. Let us say you have something like TBaseType(Variable).Method, you want to let TBaseType be a variable so you can have some code like this. procedure (value:someType) var variableType: TClass; //not quite sure here variab

Re: [fpc-pascal] ARM-Cortex port

2010-08-23 Thread Andreas Berger
Thanks Jonas and Jeppe for your answers. I will probably wait then to switch (or try to convince the company to use an ARM-9) On 23/8/2010 11:21 AM, Jeppe Johansen wrote: Den 23-08-2010 16:09, Andreas Berger skrev: I know that FPC works under ARM+Linux. Is this also true for the Cortex ver

Re: [fpc-pascal] ARM-Cortex port

2010-08-23 Thread Jeppe Johansen
Den 23-08-2010 16:09, Andreas Berger skrev: I know that FPC works under ARM+Linux. Is this also true for the Cortex version of ARM? One of our major applications is written in C++ simply because it is to run in the future on an embedded system as well as the PC. Well the embedded processor ha

Re: [fpc-pascal] ARM-Cortex port

2010-08-23 Thread Jonas Maebe
On 23 Aug 2010, at 16:09, Andreas Berger wrote: I know that FPC works under ARM+Linux. Is this also true for the Cortex version of ARM? One of our major applications is written in C+ + simply because it is to run in the future on an embedded system as well as the PC. Well the embedded proce

[fpc-pascal] ARM-Cortex port

2010-08-23 Thread Andreas Berger
I know that FPC works under ARM+Linux. Is this also true for the Cortex version of ARM? One of our major applications is written in C++ simply because it is to run in the future on an embedded system as well as the PC. Well the embedded processor has been chosen - the Luminary (TI) ARM-Cortex