• Reference Guide


The calculator is a built-in tool used for simple quick calculations whenever you may need it. It is invoked by the Tools|Calculator menu command.
The calculator window consists of a table with three columns. The first column contains a name of the required expression. The name must be unique. You do not have to enter it manually; it is automatically supplied when you insert a new row. The second column contains an expression that should be evaluated. A new row is typically created when you enter an expression into the empty row at the end of the table. In addition to common mathematical operators, expressions may contain all Enki language constructs. The result of the expression must be a decimal number (Real type). The result of the expression is continuously displayed in the last column.
In addition to numeric constants, you can also use names of other expressions to specify a new expression. Consequently, a change of the result of a particular expression is reflected in the results of all other expressions that include the result of the former expression by reference.
Besides the names of other expressions, an expression can also reference data of the document that was active when you opened the calculator. For example, if there is an i item in the document data, you can reference it by master.data.i. Likewise, you can reference views by master.view.
This technique allows you to specify complex expressions. Suppose there is a table called table with a numeric column called value in the document data. The sum of this column can be computed by the calculator using the following expression:
for(&i=master.data.table) (@i+i.value)
(See the description of for cycle in the Enki language).