variable
The report writer allows you to define variables, assign values to
them, and use them much like columns of a table.
assignment statement
The assignment statement
«variable>
"int" "real" "double" "date" "time" <#> |
"="
<expression>
defines <variable> (if it hasn't yet been defined), gives it
a type ("int" is the default, <#> is the length of a text variable),
and assigns it the value of <expression>.
Variable names are similar to column names.
expression
The <expression> is any rational (to Rim) combination of values,
table columns, and variables connected by the
mathematical operators "+", "-", "*", and "/", with parenthesis
allowed to specify operator precedence.
This is much like the assignment statement of any common programming
language. For example,
temp_id = id
xsym 8 = symbol
next_day = m_date + 1
ave_error = (tot_resist - ave_resist) / count
are valid assignment statements. These rules govern
expressions.
- Text data may be concatenated with the + operator.
- Vector and matrix elements may be specified
by <name>"("<item>")" or <name>"("<row> <column>")"
in standard Rim fashion.
vectormatrix
- If both operands are integers, the arithmetic
and the resultant will be integer.
- If either operand is real or double, the arithmetic
and the resultant will be double precision.
- The default operator precedence is left to right
in all cases. For example,
<"a+b*c" ≡ "(a+b)*c".
- When a real value is converted to an integer, the value is truncated.
realinteger
- String values are either padded with blanks or truncated
to match the length of the receiving variable.
- Date and time columns are treated as integers.
datetime
- Any occurrence of ``missing values'' in an expression
gives the expression a ``missing value''.
missing value
- There are four pre-defined variables: