Simple math can be performed using any existing Instant Database variable which has been assigned a numeric value. Create a formulas and assign its result to another variables.
Pathagoras can perform addition, subtraction, multiplication or division on up to four operands.
The mask would contain all of the client/customer information plus the variables needed for the calculations |
Example: Let's say that you have a document containing, among others, four variables intended to calculate a total price. Perhaps they are called [Unit Price], [Quantity], [Discount] and [Total Price]. These variables are repeated in the mask designed for this particular document.
The formula in the mask adjacent to [Total Price] might look like one of these:
[Unit Price] x [Quantity] - [Discount] (if the discount is a flat amount) OR
[Unit Price] x [Quantity] * [Discount] (if the discount is a percentage).
In actual operation, you would assemble the document for the customer and display the appropriate IDB mask. You would complete the 'personal variables' (name, address, etc.) and insert the appropriate values for each of the first three variables (unit price, quantity and discount) which feed the formula.
When Pathagoras detects a formula (the presence of math symbols is the give away) in the personal data side of the IDB screen, it will display a small red button between the two columns. (Similar in size to the ‘date picker’ button.) Click the red button and the formula is processed.
If any figure that is part of the formula changes, the [Total Price] can be recalculated by two successive clicks of the calculator button. The first click restores the formula. The second click recalculates using the new values.

A mask called Order Form was created for a particular type of document. It contains a simple formula to calculate the value for Total of Order.

When the mask is completed, and after values have been assigned to the variables upon which the formula depends, click the Calculate button. If figures change, click the button twice more to recalculate the value.
Page url: http://www.pathagoras.com/help/index.html?calculator_features_2.htm