August 29, 200718 yr 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, 200718 yr by Guest
August 29, 200718 yr Author 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!
August 29, 200718 yr Suppose I told you mathematical operators were evaluated before text operators - would your results make sense then?
August 29, 200718 yr Author : 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, 200718 yr by Guest
August 29, 200718 yr Author 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, 200718 yr by Guest
August 29, 200718 yr 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.
August 29, 200718 yr 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.
Create an account or sign in to comment