Re: [fpc-pascal] sizeof TTypeKind?

2020-03-22 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am So., 22. März 2020, 07:28: > > > > 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

Re: [fpc-pascal] sizeof TTypeKind?

2020-03-21 Thread Ryan Joseph via fpc-pascal
> On Mar 21, 2020, at 10:15 PM, Sven Barth via fpc-pascal > 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

Re: [fpc-pascal] sizeof TTypeKind?

2020-03-21 Thread Sven Barth via fpc-pascal
Am 21.03.2020 um 08:47 schrieb Ryan Joseph via fpc-pascal: On Mar 21, 2020, at 9:39 AM, Ryan Joseph via fpc-pascal wrote: I'm going to loop through the fields of the record and get the size of each field so I can serialize the record. Am I not on the right track? No answers on this so I'm

Re: [fpc-pascal] sizeof TTypeKind?

2020-03-21 Thread Ryan Joseph via fpc-pascal
> On Mar 21, 2020, at 10:05 AM, Anthony Walter via fpc-pascal > wrote: > > I think what Ryan is asking about is how to find the size of the variant part > of TTypeData as used in the "case TTypeKind of" section. As in: Yes. It says a field is "tkInteger" but what size is that? I know it's 4

Re: [fpc-pascal] sizeof TTypeKind?

2020-03-21 Thread Ryan Joseph via fpc-pascal
> On Mar 21, 2020, at 9:39 AM, Ryan Joseph via fpc-pascal > wrote: > > I'm going to loop through the fields of the record and get the size of each > field so I can serialize the record. Am I not on the right track? No answers on this so I'm thinking maybe I need to use

Re: [fpc-pascal] sizeof TTypeKind?

2020-03-20 Thread Anthony Walter via fpc-pascal
I think what Ryan is asking about is how to find the size of the variant part of TTypeData as used in the "case TTypeKind of" section. As in: public {$ifdef PROVIDE_ATTR_TABLE} AttributeTable : PAttributeTable; {$endif} case TTypeKind of

Re: [fpc-pascal] sizeof TTypeKind?

2020-03-20 Thread Ryan Joseph via fpc-pascal
I'm going to loop through the fields of the record and get the size of each field so I can serialize the record. Am I not on the right track? - Regards, Ryan Joseph -- Sent from: http://free-pascal-general.1045716.n5.nabble.com/ ___

Re: [fpc-pascal] sizeof TTypeKind?

2020-03-20 Thread Sven Barth via fpc-pascal
Am 20.03.2020 um 08:32 schrieb Ryan Joseph via fpc-pascal: Are there any functions in the RTL to get the sizeof the type specified in TTypeKind? https://www.freepascal.org/docs-html/rtl/typinfo/ttypekind.html I'm truing to use record RTTI and I needed to know the size of the field in the

[fpc-pascal] sizeof TTypeKind?

2020-03-20 Thread Ryan Joseph via fpc-pascal
Are there any functions in the RTL to get the sizeof the type specified in TTypeKind? https://www.freepascal.org/docs-html/rtl/typinfo/ttypekind.html I'm truing to use record RTTI and I needed to know the size of the field in the record. Regards, Ryan Joseph