Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

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

  • Author

David, 

 

Thank you :-)

 

Evaluate work perfectly :-)

 

Tom

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.