The Formula Editor dialog box is used to edit formulas (see p. 25). It can be displayed by clicking a button next to a formula in the Data Sets dialog box (p. 39), the Object Properties dialog box (p. 49), or the Import Shapefile dialog box (p. 24). The formula editor dialog box has four main parts (fig. 23):
The relative size of the formula text box and the data set and function list can be adjusted by clicking on the boundary between them and dragging with the mouse button held down.
![]() |
Figure 23. Formula editor. |
---|
The formula text box is used to compose the formula.
Three
methods can be used to create the formula. (1) The formula can be
typed in the formula text box directly. (2) The number and operator
buttons can be used to insert items into the formula. (3) The
data set and function list can be used to insert items into the
formula. When the formula is complete, the user clicks the OK
button. If the formula is valid, the formula will be accepted and
the Formula Editor will close. If it is invalid, an error message
will be displayed and the Formula Editor will remain open.
The number and operator buttons all work the same way; when the user clicks one of the buttons, the text displayed on the button will be inserted in the Formula text box at the position of the cursor. If any text in the formula is selected, it will be replaced. See “Operators” on p. 27 for more information on what the operators mean.
The data sets and functions that can be included in a formula are listed in the Data Set and Function list on the right in the Formula Editor. For compactness, they are shown in a tree view. To see the available data sets or functions click the plus (+) sign to the left of "Data Sets" or "Functions" to expand the list. Within functions, there are additional lists that can be expanded by clicking the plus sign to their left. When the terminal branches of the tree are visible, the user can double click on one of them to insert it into the formula at the location of the cursor. If any text in the formula is selected, it will be replaced by the data set or formula. For more information on the meanings of the functions, see “Functions” on p. 28.
Not all data sets will be listed in the data set list because not all data sets can be included in a formula for all other data sets. For instance, a formula for a data set can not include a reference to itself either directly or indirectly. For example, if the formula for Ky is "Kx", the formula for Kx could not include Ky because that would make the formula for Kx depend on itself. Another example of a circular reference that is not allowed is to set the formula for Ky to Kx, the formula for Kz to Ky, and the formula for Kx to Kz. Because Kx ultimately refers back to itself, this circular reference is not allowed.
Another requirement for a data set to be included in a formula is that the data set used in the formula must be evaluated at the same locations as the data set or object for which the formula is being set up. For example, Kz can include a reference to Kx because both Kx and Kz are evaluated at elements. However, Kz can not include a reference to Initial Head because Kz is evaluated at elements and Initial Head is evaluated at nodes.
Finally, the formula for a two-dimensional data set can only include a reference to two-dimensional data sets with the same orientation. However, the formula for three-dimensional data sets can include a reference to a two-dimensional data set.
The Select Matching Parenthesis button helps the
user determine which parenthesis in a formula goes with which other
parenthesis. If an opening or closing parenthesis is selected in
the formula, the button becomes enabled. Then if the button is
clicked, the matching parenthesis will become selected. For
example suppose the formula is ((A + B) * C) and the opening
parenthesis just before "A" is selected. If the "Select Matching
Parenthesis" button were clicked, the closing parenthesis just after B
would be selected. The large, bold text in the two formulas below
indicates what was selected before and after clicking the button.
((A + B)
* C)
((A + B) * C)
The Function Help button is used to obtain help on a particular function. If a function is selected in the Data Set and Function List, the Function Help button will become enabled. Clicking the button will bring up a description of the function that was selected. The functions are also described in this report in “Functions” on p. 28.