[fpc-pascal] Typinfo incompatibilities between FPC and Delphi

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Sun Jun 8 17:03:08 CEST 2014

On 2014-06-03 10:08, Sven Barth wrote:
> If one uses a helper function like you did then it's indeed not as bad,
> but if one doesn't...

Indeed. :) I find it is often amount managing readability of code. The
application developer doesn't need to worry to much about the difference
between platforms - if you give them the right tools. After all, that is
what FPC is all about.

> Out of curiosity: is this helper declared as "inline"? Would get rid of
> the call completely in both Delphi and FPC...

A very good suggestion thanks. I'll apply that immediately.

>> I've also introduced an enhanced GetPropInfo() with a signature as
> follows:
>> function tiGetPropInfo(AClass: TClass; PropPath: string; PInstance:
>> Pointer): PPropInfo;
> Might also profit from a declaration as "inline" :)

This one might not work as inline, as it is much more involved. Also
note the PropPath property. tiOPF can handling calls like:

  tiGetPropInfo(MyObject, 'Contact.Address.PostCode', ...)

It will iterate through the MyObject.Contact.Address.PostCode
properties, obviously doing NULL checks along the way. Hence the name
"PropPath" (property path).

  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the fpc-pascal mailing list