Setup: FMS19, FMP19, Win 10
My point-of-sale (POS) system runs a “set total of sale” script after each item is added to a sale. This script calculates the city and county taxes, line total, and sale total. The POS has a preferences table with multiple options/parameters for setting the tax rate (e.g., by company, location, workstation, etc).
Therefore, the script is somewhat complex, with many if/else if branches depending on the tax methodology being used. The script makes liberal use of the SUM function to calculate these totals. My goal is to make this script run faster.
QUESTION: When executing a script, does FMP19 evaluate “all” of the SUM functions in every branch — regardless of whether it’s the “correct” branch — or just the branche(s) that correspond to the preferences I’ve set? (Logically, I’d think only the branches being executed would be evaluated; however, I don’t know if this is how the engine actually works.)