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). Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal