In CTL2, I’m trying to loop through fields and reference them somewhat dynamically like this:
metadata0 myrec;
integer fcount;
fcount = length(myrec);
printLog(info, fcount);
for(integer i=0; i<fcount;i++)
{
printLog(info, $0.i);
}
It complains about ‘i’ not being an input metadata field. It’s a variable. I can printLog(info, $0.1) and it works. How can I use variables in the same way? Or, is there a different way to loop through the fields to process their values?