We would like to have a general CONSTRUCT statement, but...since
that is not possible, we have simulated one in an input array
where the array is all strings.
...
Thanks,
Candy
I think it is possible to write a general CONSTRUCT statement.
Does each column of the array correspond to each field. If so have a look at my auitree example in sourcefourjs and in particular the generic zoom functionality. The technique is to have 3 columns for each generic field, one text, one numeric, and one date and hide the two columns that don't apply. (I didn't do it in that example but change the pre-processor line in the .per so that the date columns are DATEEDITS, I was more focused on the sorting of the columns in the display array rather than inputing data). I know that code seems like a lot of work and I wish it was easier but its cheaper than coding practically the same thing over and over again.
If you have gone the other way and made each row of the array correspond to each generic field (and have two columns prompt and value) then its not so easy in an array. Maybe something like this would have potential, using the DOM functions to hide the ununsed columns and rows
LAYOUT
GRID
{
Field 1 [f01 :f02 :f03 ]
Field 2 [f11 :f12 :f13 ]
}
END
ATTRIBUTES
f01 = formonly.field1c;
DATEEDIT f02 = formonly.field1d, HIDDEN;
f03 = formonly.field1n TYPE FLOAT, HIDDEN;
f11 = formonly.field2c, HIDDEN;
DATEEDIT f12 = formonly.field2d;
f13 = formonly.field2n TYPE FLOAT, HIDDEN;