is there any possibility to access the names of a structure field during run time? I know, that the structure field are just used for specifying the offset at which the desired information is placed in the memory relative to the address of the structure variable. However, e.g. when using InsertJSONStructure(), the program obviously uses the structure field names for the corresponding JSON it generates. So I thought there has to be some way to implement this although I was not able to find anything here.
The specific case for which I want to use this is the following:
Code: Select all
Select name$
Case "id"
offset = OffsetOf(struc\id)
Case "name"
offset = OffsetOf(struc\name$)
Case "value"
offset = OffsetOf(struc\value)
Case "other_stuff"
offset = OffsetOf(struc\other_stuff$)
Case "etc"
offset = OffsetOf(struc\etc$)
; ...
EndSelect