[fpc-pascal] How to find address of record member

2018-07-08 Thread Bo Berglund
Say I have a record type defined like this: TAppData = packed record //Total 8 bytes per app ActiveToken: word; //Matches constant for app if active Option: word; //16 option bits ExpDate: word; //Integer TDateTime values Info: word;//16 info bits end; The da

Re: [fpc-pascal] How to find address of record member

2018-07-08 Thread Martin
On 08/07/2018 17:07, Bo Berglund wrote: Say I have a record type defined like this: TAppData = packed record //Total 8 bytes per app ActiveToken: word; //Matches constant for app if active Option: word; //16 option bits ExpDate: word; //Integer TDateTime values I

[fpc-pascal] Benchmarks

2018-07-08 Thread Terry A. Haimann
I am curious, Has anyone benchmarked the new AMD Ryzen vs Intel chips with FreePascal.  10 years or so ago, I had a multi core AMD Desktop and an Intel based laptop.  With FreePascal the laptop was outperforming the desktop.  When I upgraded that machine, I upgraded to Intel since I use FreePascal

Re: [fpc-pascal] How to find address of record member

2018-07-08 Thread Bo Berglund
On Sun, 8 Jul 2018 17:16:01 +0200, Martin wrote: >On 08/07/2018 17:07, Bo Berglund wrote: >> Say I have a record type defined like this: >> >>TAppData = packed record //Total 8 bytes per app >> ActiveToken: word; //Matches constant for app if active >> Option: word; //16 optio

Re: [fpc-pascal] How to find address of record member

2018-07-08 Thread Bo Berglund
On Sun, 08 Jul 2018 18:28:34 +0200, Bo Berglund wrote: >I tried this: >var > offs: word; >begin > ... > offs := @FAppData.Info - @FAppData; //Info is 4th member of record > address := AppBase + (AppNumber -1) * (SizeOf(TAppData) div 2) + >offs; > >But it was not accepted by the compiler (on t

Re: [fpc-pascal] Searchable docs online

2018-07-08 Thread Ryan Joseph
Just tried to use https://www.freepascal.org/docsearch/docsearch.html and it seems to have a bug (not working, errors in the JS console). Awaiting the source on svn also. :) Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.fre

Re: [fpc-pascal] How to find address of record member

2018-07-08 Thread Martin
On 08/07/2018 19:08, Bo Berglund wrote: But typecasting the operation fixed the problem: offs := Cardinal(@FAppData.Info) - Cardinal(@FAppData); No compiler errors here anymore. May be a result of {$TYPEDADDRESS On} which may be default in some mode switches. Untyped pointers seem to be s

Re: [fpc-pascal] Searchable docs online

2018-07-08 Thread Michael Van Canneyt
On Sun, 8 Jul 2018, Ryan Joseph wrote: Just tried to use https://www.freepascal.org/docsearch/docsearch.html and it seems to have a bug (not working, errors in the JS console). Awaiting the source on svn also. :) Possibly, I have been doing some experiments. I have re-enabled it. It is no