In a report program, constants are represented in two ways: as a string or as a number. The following table shows how each C/Base data type may be represented as a constant value:
char string "c"
string string "Hi there"
int string or number "10" or 10
real string or number "10.1" or 10.1
money string or number "10.23" or 10.23
date string "01/01/82" or "010182"
time string "01:55:00" or "1:55a"
In cases where the value may be represented either as a string or a number, the Report Writer will do conversions when necessary. Thus, 10 and "10" are treated as the same values. Since the Report Writer will have no way of knowing what type of value is represented in a string, the following rules are applied to help make the decision:
If the expression is a single value, leave the string as a string.
If a string is involved in any operation with a money value, convert the string to a money value.
If the string is involved in an addition or subtraction, try converting to a date.
If the string contains a colon (:), and is involved in an addition or subtraction, try converting to a time value.
If the string is involved in any arithmetic operations and the previous rules failed, convert the string to a number.