Variables

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> $\Bigl\langle$
"int" "real" "double" "date" "time" <#>
$\Bigr\rangle$ "=" <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.

  1. Text data may be concatenated with the + operator.
  2. Vector and matrix elements may be specified by <name>"("<item>")" or <name>"("<row> <column>")" in standard Rim fashion. vectormatrix
  3. If both operands are integers, the arithmetic and the resultant will be integer.
  4. If either operand is real or double, the arithmetic and the resultant will be double precision.
  5. The default operator precedence is left to right in all cases. For example,  <"a+b*c"         ≡         "(a+b)*c".
  6. When a real value is converted to an integer, the value is truncated. realinteger
  7. String values are either padded with blanks or truncated to match the length of the receiving variable.
  8. Date and time columns are treated as integers. datetime
  9. Any occurrence of ``missing values'' in an expression gives the expression a ``missing value''. missing value
  10. There are four pre-defined variables:
    \begin{List}
\item[{''page_number''}] -- the number of the current page,
\I{pa...
...me at the start of report execution.
\I{report_time@''report_time''}
\end{List}