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
Zitat von Florian Klaempfl :
I am happy to implement this in delphi mode, but it requires some
documentation references how delphi evaluates such expressions
(which precision is used when and why) and how they are handled in
expressions.
These links may be of interest:
http://docwiki.e
> 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
Am 09.07.2018 um 19:55 schrieb g...@wolfgang-ehrhardt.de:
Zitat von Martok :
To make sure this works, one has to manually make the const expression
be of the
type required:
const
e: Extended = Extended(1.0) / 3.0;
I seem to remember that this was once documented somewhere for Delphi.
Can't
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
Zitat von Martok :
To make sure this works, one has to manually make the const
expression be of the
type required:
const
e: Extended = Extended(1.0) / 3.0;
I seem to remember that this was once documented somewhere for Delphi. Can't
seem to find it though, so maybe it was a 3rd-party book?
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
To connect to a server, I need to use Google's Protocol Buffer format.
The only workable parser to convert the protocol definition file to
pascal reader/writer source code is:
the ProtoBufCodeGen in
https://github.com/fundamentalslib/fundamentals5/releases
Still, there is no documentation on
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
Am 03.07.2018 um 23:10 schrieb Florian Klämpfl:
>> OK, then two questions remain: Why does is occur/apply only for (newer?)
>> 3.1.1 versions?
> I dug a little bit deeper, the reason is:
> https://bugs.freepascal.org/view.php?id=25121I tried figuring this out,
> sharing what I found here for refe
10 matches
Mail list logo