field name as variable
Posted on 2010-09-22
I have the following situation:
a data structure defined as:
File1Fields E DS Extname(File1)
in File2 (fldname,value) I have all the field names of File1 and their values (fld1,val1 ; fld2, val1).
now, i want to initialize File1Fields with the values from file2,
File1Fields.fld1 would equal a value of fld1 from File2 and so on...
The problem is how to reference those fields in File1Fields without hardcoding their name
and having only field name in a variable (field) of File2.
if there would be a way to iterate through a data structure than there would not be a problem:
File1Fields(i) = value;
Any suggestions ?