December 8, 201213 yr I have a fairly complex calculation that works fine except for one situation. Basically it's calc;calc;calc/number_services plus a lot of other items. It doesn't work, of course, if number_services is "0" because you can't divide by zero. It messes up the whole calculation. So just for fun I tried calcs etc/number_services>0 and it worked. I'm quite surprised that FM would accept field>0 as a definition. Am I missing something here? As it turns out I didn't trust this method and set up validation on the number_services field to be not empty and to have a value greater than zero instead. This is academic for sure, but I'm curious all the same.
December 8, 201213 yr Author The file is huge. The question is academic. Think of it this way. 600/number_services. If number_services is 6, the answer is 100. If number_services is 0 the answer is ?. If the calc is 600/number_services>0 other parts of the calculation work fine.
December 8, 201213 yr This is interesting. I didn't know you could skip an error this way. What happens here, I think, can be explained by = 0 / 0 = "?" returning True instead of error. IOW, Filemaker puts the error (or rather the error symbol) on one side of the equation and then proceeds to evaluate as if nothing has happened. OTOH = EvaluationError ( Evaluate ( "0 / 0 = "?"" ) ) returns 15 ('Can't divide by zero'), so this could well be a bug instead of intended behavior. Edited December 8, 201213 yr by comment
Create an account or sign in to comment