LaRetta Posted August 29, 2007 Posted August 29, 2007 (edited) I decided to start a new thread because I didn't want to hijack someone else's here . I just can't help myself! I wanted to understand the evaluation order of the calculation referenced ... [color:blue]a & b + c Here, you need to know the (undocumented) order of evaluation ... I created a new 9.0 file. However, even using an unstored calculation (result = number), my results wonk out. When I put a value in [color:blue]a (1) and a value in [color:blue]b (1), the calc turns to 11. I then enter 3 in [color:blue]c. Calc produces 14. No surprise. But if I delete [color:blue]b (1), the result is 13. And no refreshing changes it. In fact, if I then change [color:blue]a to 2, it produces 23. I created a new record. I put 3 in [color:blue]c and 1 in [color:blue]a. It produces 13. Not only am I still in the dark on evaluation order but the dang thing breaks!! It must be seeing field [color:blue]b as 0 so [color:blue]a = 1 & [color:blue]B = 0 = 10 + 3. I feel madness overtaking me ... (I mean more than usual, ROFLMAO!) Edited August 29, 2007 by Guest
LaRetta Posted August 29, 2007 Author Posted August 29, 2007 Oh, and I had left fields a and b as text and only the calc is number. a and b should be evaluating as text!
comment Posted August 29, 2007 Posted August 29, 2007 Suppose I told you mathematical operators were evaluated before text operators - would your results make sense then?
LaRetta Posted August 29, 2007 Author Posted August 29, 2007 (edited) : Perfect sense. a = 1 b = blank c = 3 c + b = 3 a & c = 1 & 3 = 13 nevermind But it sure shot my energy sky high for this afternoon! Better than a gallon of coffee!! Edited August 29, 2007 by Guest
LaRetta Posted August 29, 2007 Author Posted August 29, 2007 (edited) So, is the fact that mathematical operators are evaluated before text operators the undocumented feature you mentioned? Or is it just the fact that NO reference to evaluation order is made in FileMaker? I find NOTHING on the subject at all! Edited August 29, 2007 by Guest
comment Posted August 29, 2007 Posted August 29, 2007 Well, ONE reference to evaluation order exists, under "Mathematical operators": FileMaker Pro evaluates formulas from left to right, performing multiplication and division before addition and subtraction. But other than that it's a matter of testing to discover which operator takes precedence over which.
comment Posted August 29, 2007 Posted August 29, 2007 Uhm, one additional note: The "natural" result of a & b + c is Text, because the last operation was a text operation. To write the same thing explicitly: GetAsText ( a ) & GetAsText ( GetAsNumber (: + GetAsNumber © ) If you set your calculation field result to Number, then that's another conversion of the final text result to a number.
Recommended Posts
This topic is 6356 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