Fieldname in variable

i have a few procedures that assign a fieldname to a local variable then do a formulafill on a different field using the first field. something like this:

field A
local fld fld = info(‘fieldname’)
field B
formulafill datavalue(fld)

this worked in pan6: it filled B with the values in A.
in panx it fills B with ‘A’.
i’ve also tried formulafill «fld» and formulafill (fld) with the same results.

how do i get this done?

This works, but I don’t think it should be necessary.

field A local fld fld = info('fieldname') field B formulafill datavalue(datavalue(fld))

The fieldvalue( function allows you to identify a field name as a formula by putting an extra set of parentheses around it. I think datavalue( should work in a similar manner, but it doesn’t.

field A local fld fld = info('fieldname') field B formulafill datavalue((fld))

The method recommended by the help file is.

field A local fld fld = info('fieldname') field B formulafill datavalue(""+fld)

I should have looked there first.

really interesting.
datavalue(datavalue(fld)) almost makes sense.
datavalue(""+fld) is mind boggling.
(i looked in the help file but missed this.)

thanks, dave.

ok, i just read the help file entry for datavalue(.
the trick is making the argument a formula, not merely a variable.
using datavalue(fld) as the argument accomplishes the same thing.