Re: [fpc-pascal] Assign() vs AssignTo()

2016-02-12 Thread Graeme Geldenhuys
On 2016-02-12 02:17, Dennis wrote:
> Is there any sample codes to copy published properties (via RTTI) ?
> e.g. psuedo code below

Take a look at tiOPF's TtiObject.AssignPublishedProps() method.

https://sourceforge.net/p/tiopf/code/ci/tiopf2/tree/Core/tiObject.pas#l1156


The tiRTTI.pas unit also has very useful RTTI features - one being
access to properties via "property paths". It walks a object hierarchy
to get or set a property, and does error checking along the way. eg:
  tiSetProperty(lPerson, 'Address.City.Name', 'London');


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] ARM CMSIS support

2016-02-12 Thread Bernd Mueller

Michael Ring wrote:

By the way, with fpc trunc compiler you can target your board directly:

ppcrossarm  -WpDISCOVERYF407VG (see ppcrossarm -i for other Discovery 
boards)


You should also refrain from using optimizations > -O1 as there are some 
issues with the compiler that make your compiled binary unusable.


I have built the crosscompiler and the rtl for the STM32F429xx 
controller. Basic functions seem to work.


By default, the rtl is compiled with optimization -O2. Should the rtl be 
better compiled with optimization -O1 too, if there are issues with the 
compiler? Or is the rtl not affected?


What is recommended by the developers? Where bug reports accepted, if I 
use optimization -O2?


Regards, Bernd.




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] ARM CMSIS support

2016-02-12 Thread Michael Ring
Good point, Jeppe, what do you think on compiling rtl on arm-embedded 
with -O1 ?


Michael

(Glad to hear that basic functionality works...)

By the way, I have done a patch for Lazarus so that debugging with 
ST-Link/JLink/Texane works, send me an e-mail when you want to test this.


Michael

Am 12.02.16 um 15:10 schrieb Bernd Mueller:

Michael Ring wrote:

By the way, with fpc trunc compiler you can target your board directly:

ppcrossarm  -WpDISCOVERYF407VG (see ppcrossarm -i for other Discovery 
boards)


You should also refrain from using optimizations > -O1 as there are 
some issues with the compiler that make your compiled binary unusable.


I have built the crosscompiler and the rtl for the STM32F429xx 
controller. Basic functions seem to work.


By default, the rtl is compiled with optimization -O2. Should the rtl 
be better compiled with optimization -O1 too, if there are issues with 
the compiler? Or is the rtl not affected?


What is recommended by the developers? Where bug reports accepted, if 
I use optimization -O2?


Regards, Bernd.




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Nice const array messages. Thanks!

2016-02-12 Thread Anthony Walter
I just noticed this really nice compiler feature. I don't know when it as
added but it's really helpful.

When defining const array like below the compiler will tell you how many
elements are missing:

const
  Food: array[0..7] of string = (
'Apple', 'Banana', 'Cherry', 'Doughnut', 'Eclair');

Error: Expected another 3 array elements

And when you have too few elements in the array in it will make tell you
the point where it expected the array to end.

const
  Food: array[0..2] of string = (
'Apple', 'Banana', 'Cherry',| 'Doughnut', 'Eclair');

Fatal: Syntax error, ")" expected but "," found,

And in Lazarus the caret is placed where the array should have ended "|".

This is really great feature and helps a lot when declaring array constants
with many items. Thank you to whomever added this to the compiler :)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal