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.

Script Calculating

Featured Replies

I have a program that has calculations that require scripts to activate them.

Example:

"select_rate" script

If["rate_code = "4"]

Perform script[sub-script, "rate_misc_1"]

Halt script

End If

If["rate_code = "5"]

Perform script[sub-script, "rate_misc_2"]

Halt script

End If

I have about 20 of these if statements running in the "select_rate" script

"rate_misc_1" script

Enter browse Mode

set field ["rate_misc_1", "price *.10"]

rate_code is a calculation that states if the name of the rate is "name", then use this Code #.

Example:

Rate = "10% Min 100", 2

Rate = "10% Misc", 4

and so on.

The rate_code is based on a value list I have setup with all the names of the rates.

My question is this:

Do I have this setup right, or is there an easier way to achieve a value from a rate_code that is matched up with the price of the product? confused.gif

Any help on this would be appreicated.

Why do you need a script for this? Have you considered using just a plain calc field that references the rate?

You could store your rates in a related file through the relationship ratename::ratename

and then your calc field could be

price*ratename::rate

To keep your figures from changing in the event you will alter rates at some later date, you could define a lookup rate field in your master file and use this as a reference in your calc field.

HTH

-Raz

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.