Calculated Field Name


#1

Remind me please of how to reference a calculated field name.

ie. How do I do reference a field that whose name needs to be dynamically calculated? When X=3, I want to reference Tank3.


#2

Use the grabdata( or datavalue( function.

value = grabdata("","Tank"+str(X))

or

value = datavalue("Tank"+str(X))

#3

I’m wanting to assign a value to Tank3, not get its value.

ie.

Tank3 = 4

when I only know that X = 3


#4

In that case

Set "Tank"+str(X), value

#5

You can also use Field (variablename) to select the field and then do formulafills etc.


#6

You can also use more complex formulas.

Field "Tank"+str(X)