December 9, 200520 yr I can't get anything but a ? to appear in a text field called "Status" with this simple autocalc lookup: Evaluate("Updated";triggerfield) When I enter something into triggerfield a "?" appears in the field called "Status". When I change the calculation to say 1+1 I get a 2. Status is definitely a text field expecting a text result. What am I doing wrong? Thanks in advance Edited December 9, 200520 yr by Guest
December 9, 200520 yr Hi chech the function format ! It must be: Evaluate ( expression {; [field1 ; field2 ;...]} ) So, if the other parameter are correct, it must be entered: Evaluate("Updated";[color:red][triggerfield[color:red]])
December 9, 200520 yr Try: Evaluate ( Quote ( "Updated" ) ; triggerfield ) It cannot work the way you have it now, because Filemaker is trying to evaluate the formula you gave it inside the quotes. For example, Evaluate ("2+2") will return 4.
December 9, 200520 yr Author Evaluate("updated";triggerfield) Is "updated" not merely a text constant?. What if I wanted it to calculate as this: Evaluate(field1&field2;triggerfield) Shouldn't it just calculate the concatenation? It doesn't. It puts a ? mark in the Status field. Remember this is in the "Auto Enter" "Specify Calculation" area of the Options of a text field called status. I want the word "Updated" to show in the status field if the triggerfield has any change made to it.
December 9, 200520 yr Is "updated" not merely a text constant? Yes, it is. And so is "2+2". That's what Evaluate() is all about: it evaluates its input as calculation. Evaluate(field1&field2;triggerfield) Shouldn't it just calculate the concatenation? No. If you want the concatenation, then use plain field1&field2 Putting the concatenation inside Evaluate() means you want the result of the concatention to be the expression parameter. And again, Evaluate () evaluates expression as a calculation. If field1 contains "2+", and field2 contains "2", the result will be 4 again.
December 9, 200520 yr as always, comment is right ! Try this calc too Evaluate ( Quote ( "Updated " & Get ( CurrentTimeStamp )) ; [ triggerfield]) BTW I'm learning just now that, if the trigger field is only one, the function doesn't need square brackets ! This is from FM help on line: Evaluate(TextField;[Amount]) returns .80 when TextField contains .08 * Amount and the Amount field contains 10.00.
December 10, 200520 yr It is not even necessary to use Evaluate() here. Any reference to the trigger field will cause the calc to re-evaluate when the trigger field is modified: Let ( trigger = triggerfield ; "Updated" ) will accomplish the same thing, and IMHO is much clearer.
December 10, 200520 yr Author Yes that's done it. That seems to make whatever I try work with the evaluate function. thanks
Create an account or sign in to comment