Skip 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.

Using text field to generate calculation

Featured Replies

I would like to customize my calculations, in that, whatever I type into a text field, I would like that to be used as the calculation in another field

Example,

I have four fields: A_1 , A_2, B_1, C_1

I would like to enter the equation 'sum(A_1, A_2)' (or any valid FMP equation) into the C_1 field, and have the B_1 field display the result of that equation.

cheers

kevin

There is a plugin doing this, KS Calculator

Can't remember the URL, sorry

  • Author

Actually I was not looking for a calculator.

Here's another explanation.

I would like to enter the formula 'sum(A_1, A_2)' or some other valid FMP expression such as 'GetField(A1)' into a field (text or not) and have another field perform that operation. So, instead of entering 'sum(A_1, A_2)' into the field "B_1" directly, I would like to type it into a field named "C_1" and have the "B_1" field display the result of that formula. This would give me the flexibility to change my calculation at will.

I hope I was much clearer this time.

thanks

kevin

Basically,

I've done a simple 4-function calculator on two fields and it turned out to be very complex, because each variation has to be hard-coded into the system. More functions and more variables will increase the cmplexity geometrically.

Summary: yes it can be done, but it's gonna be a huge undertaking. Start by working out how many variables you want to work with, and the number of functions you want to support. The fewer of each the better.

For example, the calc I made went something like this:




Case [operator = "+", A + B,

      operator = "-", A - B,

      operator = "*", A * B,

      operator = "/", A / B]







Increasing the function to fit three variables is significantly more work, since there are now 16 diferent permutations of functions to calculate to support the four functions... it'll be n*n for n functions.







Case [operator1 = "+" and operator2 = "+", A + B + C,

      operator1 = "+" and operator2 = "-", A + B - C,

      operator1 = "-" and operator2 = "+", A - B + C,

      operator1 = "-" and operator2 = "+", A - B - C,

      ... yada yada yada...]



Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.