On 09/07/2018 18:22, Ryan Joseph wrote:
Could I do some RTL magic on a record to loop over its fields and set them to
another record by name? In the example below I want to set all the fields in
TRecA to matching named fields in TRecB. Just curious if we can do this
automatically using RTL.
t
On 7/9/2018 9:22 AM, Ryan Joseph wrote:
Could I do some RTL magic on a record to loop over its fields and set them to
another record by name? In the example below I want to set all the fields in
TRecA to matching named fields in TRecB. Just curious if we can do this
automatically using RTL.
t
> On Jul 9, 2018, at 11:57 AM, gabor wrote:
>
> Hi.
> Probably can be done with RTTI (1), enumerators (2) and generics (3) together.
>
> 1. https://stackoverflow.com/questions/27803383/fpc-rtti-on-records
> 2. http://wiki.freepascal.org/for-in_loop#Traversing_container
> 3. http://wiki.freepas
Hi.
Probably can be done with RTTI (1), enumerators (2) and generics (3)
together.
1. https://stackoverflow.com/questions/27803383/fpc-rtti-on-records
2. http://wiki.freepascal.org/for-in_loop#Traversing_container
3. http://wiki.freepascal.org/Generics
Michał.
W dniu 2018-07-09 o 18:22, Ryan
Just because someone is bound to suggest it, might as well be me.
type
TRecA = record
a: string;
b: string;
end;
type
TRecB = record
A: TRecA;
c: integer;
d: integer;
end;
RecB.A := Re
Could I do some RTL magic on a record to loop over its fields and set them to
another record by name? In the example below I want to set all the fields in
TRecA to matching named fields in TRecB. Just curious if we can do this
automatically using RTL.
type
TRecA = record