Re: [fpc-pascal] Delphi-FPC difference in handling TList

2015-10-19 Thread Mattias Gaertner
On Tue, 20 Oct 2015 08:31:57 +0200 Bo Berglund wrote: > I am porting a Delphi class to FPC and I ran into a problem concerning > TList: > > FCommands.Sort(CommandCompare); > > This generates an error: > Error: Wrong number of parameters specified for call to > "CommandCompare" > > This call wo

[fpc-pascal] Delphi-FPC difference in handling TList

2015-10-19 Thread Bo Berglund
I am porting a Delphi class to FPC and I ran into a problem concerning TList: FCommands.Sort(CommandCompare); This generates an error: Error: Wrong number of parameters specified for call to "CommandCompare" This call works just fine in Delphi and I have no clue as to why it happens in FPC. Com

Re: [fpc-pascal] Byte order modification in fpc on ARM?

2015-10-19 Thread Bo Berglund
On Mon, 19 Oct 2015 15:32:00 +0200, Jonas Maebe wrote: > >Bo Berglund wrote on Mon, 19 Oct 2015: > >> Is there a function or such to interrogate the byte order of the >> platform FPC runs on? So that I could add a test at the start of >> download to check if swapping is needed? > >Use the http://

Re: [fpc-pascal] Byte order modification in fpc on ARM?

2015-10-19 Thread Sven Barth
Am 19.10.2015 16:23 schrieb "Bo Berglund" : > > On Mon, 19 Oct 2015 15:30:36 +0200 (CEST), Michael Van Canneyt > wrote: > > >There are compiler defines that give you the endianness. > >{$IFDEF ENDIAN_BIG} > >{$IFDEF ENDIAN_LITTLE} > > > >And > >{$IFDEF FPC_LITTLE_ENDIAN} > >{$IFDEF FPC_BIG_ENDIAN}

Re: [fpc-pascal] Byte order modification in fpc on ARM?

2015-10-19 Thread Bo Berglund
On Mon, 19 Oct 2015 15:30:36 +0200 (CEST), Michael Van Canneyt wrote: >There are compiler defines that give you the endianness. >{$IFDEF ENDIAN_BIG} >{$IFDEF ENDIAN_LITTLE} > >And >{$IFDEF FPC_LITTLE_ENDIAN} >{$IFDEF FPC_BIG_ENDIAN} Good, that would probably be what I need. Thanks! Example: pro

Re: [fpc-pascal] Byte order modification in fpc on ARM?

2015-10-19 Thread Karoly Balogh (Charlie/SGR)
Hi, On Mon, 19 Oct 2015, Jonas Maebe wrote: > Bo Berglund wrote on Mon, 19 Oct 2015: > > > Is there a function or such to interrogate the byte order of the > > platform FPC runs on? So that I could add a test at the start of > > download to check if swapping is needed? > > Use the http://www.free

Re: [fpc-pascal] Byte order modification in fpc on ARM?

2015-10-19 Thread Karoly Balogh (Charlie/SGR)
Hi, On Mon, 19 Oct 2015, Bo Berglund wrote: > I am making a control program for a data collection system using FPC + > Lazarus on a Raspberry Pi2 platform. I will use a number of Delphi > units, which implement the communications and data handling needs in a > way that works fine on a Windows pla

Re: [fpc-pascal] Byte order modification in fpc on ARM?

2015-10-19 Thread Jonas Maebe
Bo Berglund wrote on Mon, 19 Oct 2015: Is there a function or such to interrogate the byte order of the platform FPC runs on? So that I could add a test at the start of download to check if swapping is needed? Use the http://www.freepascal.org/docs-html/rtl/system/ntobe.html function and yo

Re: [fpc-pascal] Byte order modification in fpc on ARM?

2015-10-19 Thread Michael Van Canneyt
On Mon, 19 Oct 2015, Bo Berglund wrote: I am making a control program for a data collection system using FPC + Lazarus on a Raspberry Pi2 platform. I will use a number of Delphi units, which implement the communications and data handling needs in a way that works fine on a Windows platform. W

[fpc-pascal] Byte order modification in fpc on ARM?

2015-10-19 Thread Bo Berglund
I am making a control program for a data collection system using FPC + Lazarus on a Raspberry Pi2 platform. I will use a number of Delphi units, which implement the communications and data handling needs in a way that works fine on a Windows platform. While looking over existing code I see that th