Previous Topic: Specifying Column FormatsNext Topic: Examples


Defining Column Levels and Values

Three Levels of Columns

A column can be one of three column levels, as follows:

Predefined Column Values

For element-level and work-level columns, you can include a value for the column as part of the column definition. Column values can be predefined in various ways.

Initial Value

You can specify an initial value that provides a default value for any column except one with a display format of G. You can define an initial value for a column that is appropriate for most rows in the table. The initial value must be consistent with the column width and type, and can be a number or a literal (literals must be enclosed in quotation marks). If no initial value is specified, ASF provides the following initial values:

Calculated Value

You can specify a calculation for a column that is computed when the column is displayed or stored.

You can define both an initial value and a calculation for a single column, but most often you will use one or the other.

The initial value for a column appears as the column entry when you display the table to add a row. If no other value is supplied for the column when the table is stored, the initial value is stored as the column entry.

A calculation is an expression that is evaluated by ASF, as follows:

Fixed Value

A calculation can be a single value, like an initial value, that ensures a fixed value for a column. The value specified as the calculation overrides any value entered in the column and is always the value displayed or stored. The value specified can be a number, literal (enclosed in quotation marks), or another column in the table. The most common use of a single-value calculation is to reference another column in the table, as shown in Example 2 below.

Though single-value calculations are allowed, a calculation is typically an arithmetic expression that is calculated for a numeric column or for a text column containing numeric data.

As noted above, a calculation overrides any value entered in a column, though an entered value can be used to evaluate the expression in the calculation.

Arithmetic expressions can include:

ASF follows the standard order of precedence when evaluating arithmetic expressions. The order is: multiplication or division from left to right, then addition and subtraction from left to right, with operations in parentheses resolved first. If more than one calculation has been defined in a table, the calculations are evaluated in the order in which the columns were defined.