Digital Life Posted December 9, 2005 Posted December 9, 2005 (edited) 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, 2005 by Guest
Raybaudi Posted December 9, 2005 Posted December 9, 2005 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]])
comment Posted December 9, 2005 Posted December 9, 2005 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.
Digital Life Posted December 9, 2005 Author Posted December 9, 2005 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.
comment Posted December 9, 2005 Posted December 9, 2005 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.
Raybaudi Posted December 9, 2005 Posted December 9, 2005 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.
comment Posted December 10, 2005 Posted December 10, 2005 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.
Digital Life Posted December 10, 2005 Author Posted December 10, 2005 Yes that's done it. That seems to make whatever I try work with the evaluate function. thanks
Recommended Posts
This topic is 6987 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now