Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-10

Need help with - howto find struct field

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jan Kowalski

Hi, I try to convert string to structure field. As example:

 function getRepF(argo,argn: string): boolean;
 begin
 ...
       dataA.'argn':=argo;
 ...
 end;

argn is a string with name of structure (dataA) field. Is there any way to do that ? somethink like FindStructField ?

Please help!

Regards
faber

Reply by email

Marco van de Voort
to Jan Kowalski

In our previous episode, Jan Kowalski said:

Show quoted text 11 lines
Hi, I try to convert string to structure field. As example: function getRepF(argo,argn: string): boolean; begin ... dataA.'argn':=argo; ... end; argn is a string with name of structure (dataA) field. Is there any way to do that ? somethink like FindStructField ?

In general: no. In compiled languages, identifier names are generally eliminated in the compilation process.

There are remote cases possible for classes (RTTI/introspection), but these are special cases. See the examples for e.g. unit typinfo.

Reply by email