Rick Whitelaw Posted December 8, 2012 Posted December 8, 2012 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.
Lee Smith Posted December 8, 2012 Posted December 8, 2012 Why don't you post a copy of your file, a markup, or a copy of your calc.
Rick Whitelaw Posted December 8, 2012 Author Posted December 8, 2012 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.
comment Posted December 8, 2012 Posted December 8, 2012 (edited) 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, 2012 by comment
Recommended Posts
This topic is 4426 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