Feedback

  • Contents
 

Creating Custom Calculations

IPA Designer provides a robust set of tools that help you "build" calculations quickly and easily. However, if you want to create very sophisticated calculations that combine multiple logical operators, use built-in functions, or if you simply prefer to enter calculations manually, use the Custom Calculation Builder.

Note: Be careful to use the correct units when you create a calculation. If you create a calculation that uses or accepts inconsistent units, then your process might give incorrect results. For example, if your calculation used currency units and divided 10 dollars by 2 Euros, it might give an answer of 5 dollars.

More generally, you should always check the units in your calculations. Incorrect units in your answer usually indicate that you made an error in your calculation.

To use the Custom Calculation Builder:

  1. Display the Calculation Editor dialog, then click the link Enter a custom calculation at the bottom right corner of the dialog box.

    IPA Designer displays the Custom Calculation Builder dialog box (see figure). The dialog box differs slightly based on the data type of the variable you're using in the calculation, so it might not exactly match the figure you see here.

  2. In the Calculation text box at the top, enter your calculation by any or all of these methods:

  • Type it directly into the box.

  • In the Variables / Literals tree, double-click the item(s) to insert into your calculation at the current cursor position. You can also drag it from the tree and drop it into your calculation.

  • In the Functions tree, double-click the functions or operators to insert into your calculation at the current cursor position.

  • Click the Add Function button on the dialog box toolbar to use the Function Assistant wizard.

  1. When you have finished entering the calculation:
  • Correct any errors that IPA Designer detected.

  • IPA Designer indicates where an error occurred by displaying the error's position in the calculation text. For example, if the expression begins with a five-letter variable name and then has an incorrect operator, IPA Designer says that the error is at position 6 in the calculation expression.

  • Carefully examine the calculation text to verify that the calculation does what you want it to do.

  1. Click OK.

    IPA Designer adds the calculation at the desired location in your workspace.

Tip: Function names always end with opening and closing parentheses, even if they don't take any parameters. For example, WriteLine("IPA Designer") and WriteLine() are both correct, but WriteLine without any parentheses is incorrect.