The "Edit Formula" dialog box manages the equations of parameterized input.
Entering Formulas
To define a formula for a table cell or dialog field, use one of the following options:
- Use the
button in the table toolbar
- Click on the yellow corner in the cell or dialog box (available if formula is provided)
- Use the
button in the dialog box
The "Edit Formula" dialog box appears.
Defining Formulas
The formula input is based on JavaScript and allows you to perform simple arithmetic operations. Enter the "Formula" into the text box. It can consist of numerical values, parameters, operators, and functions. If the formula is defined correctly, the 'Result' of the equation appears in the field below.
Please note:
- The use of operators (+, -, *, /, ^, ==, !=, <, <=, >, >=, &, ||) and constants (PI, e) is possible
- The use of floating point numbers can cause problems
- Comments are not possible, not even one-line comments
- Parameters may not be mentioned in their own definition; to define a parameter A, for example, write (B+C), but not (A=B+C)
- The decimal separator is not a comma, but a period
You can use the
button to open the list of Global Parameters. Then, select the parameter or define a new variable. Use the "OK & Insert" button to import the parameter into the formula.
You can describe the formula with functions that correspond to the conventions of JavaScript and the usual references. This way, you can also define conditions and conditionals for the value of the equation; for example, as follows:
- A > B ? 1 : 2
- if (A > B) 1; else 2
Furthermore, it is possible to address objects by means of their numbers and certain properties in the formula. This way, you can use, for example, the lines[3].length entry to refer to the length of Line 3. You can access the complete list of object references including syntax using the
button.
Displaying Formulas
A formula can be used in the cell of a table as well as in the input field of the corresponding dialog box. Since tables and dialog boxes are interactive, you can access the formulas in both input modes.
If a yellow triangle is displayed in the upper left corner of a cell, a formula is assigned to it. A red triangle means that the formula is incorrectly defined.
You can use the
button to control whether the formula or the corresponding value is displayed in the cell (see image 'Edit Formula' Button).
To delete a formula, select the corresponding cell. Then, click the button
.