A variable's data type determines the type of comparison performed in a condition involving the variable. This is important because comparison semantics for numbers, strings and dates are very different.
Variable data type |
Comparison semantics |
---|---|
Text |
String |
Alt Text |
String |
Text Indexed |
String |
Boolean |
Boolean |
Integer |
Number |
Rational |
Number |
Date |
Date |
When used in a condition, the variable's value is obtained in two steps:
First the text representation of the variable is formatted as usual (see formatting); this allows influencing the value in interesting ways, such as rounding a rational number or extracting a date from a date/time.
Then the value is converted to the data type appropriate for the comparison type (example: string, number, ...); as indicated in the table above.
See also: