> On Mar 21, 2020, at 10:15 PM, Sven Barth via fpc-pascal > <fpc-pascal@lists.freepascal.org> wrote: > > For the primitve types you need to know the sizes at compile time (e.g. > SizeOf(Word), SizeOf(LongInt), etc.) and check what type the field has using > the field list in the record's RTTI. You also have to keep in mind that some > types are grouped. E.g. tkInteger is for all integer types that are smaller > than 64-bit. The real type is then available as TTypeData.OrdType and you > need to handle that size accordingly. For structured types like records the > size is contained in the RTTI. The FldOffset field is important to get the > correct offset of a field, because padding might be involved depending on the > platform (except if your record is "packed").
ok, I guess I need to make a lookup table for tkInteger etc... or just take the field type names directly and map them myself. Btw, I was thinking that the new custom attributes could be used to add RTTI to record fields but it appears to be limited to classes, and other class definitions. Is that correct? Regards, Ryan Joseph _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal