Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4224 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi,

 

I am creating an estimator for a customer and I built the calculation by nesting "IF's" via a script trigger but as I increased the operators; "+, -, x, / " my nested "IF's" within my script grew exponentially.  It works great, but I am hoping for an easier solution ...

 

... I was hoping to use a "Let" statement but "Let" statements confuse me for some strange reason.

 

Here is what I would like to do if a "LET" statement can manipulate the operator characters the user selects ...

 

( 1 + 1 ) or

( 1 + 1 ) + 1 or

( 1 + 1 ) + ( 1 + 1 ) or 

( 1 + 1 ) + ( 1 + 1 ) + 1 or the user could do this ( 10 / 1 ) + ( 100 x 50 ) - 67

 

Currently the user has a drop down value list for each of the for operators to select a "+" or a "-" or a "x" or a "/" in any combination they choose. 

 

When I tried to manipulate the character selection of the user in a calculation fields, I used an "&" but I got 1 + 1 = 11 hence I was forced to script the solution.

 

One "IF" statement in my script looks like this ... see pic.

 

It would be great if I can replace my script trigger with over an Nth number of nested "IF's" and use a "Let" statement with the above example.

 

Any guidance here I would be grateful.

 

Thank you.

 

Tom

post-89394-0-40250200-1372305582_thumb.p

Posted

Mind if I take a moment to encourage you to try a completely different tack?

 

Give the user a single text entry field, say table::field. Use a calculation that is = Evaluate ( table::field )

 

If you want to enforce some rules (like limit characters to numbers and operators) use an auto-enter calculation or on object keystroke trigger and the Filter() function.

 

See attached

operate.fmp12.zip

  • Like 2

This topic is 4224 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.