| Language basics / Type conversions | |
The runtime system performs data conversion implicitly without objection, as long as the data conversion is valid. A date value can be converted to a character string, but a character string can only be converted to a date if the string represents a valid date in the current date format settings (DBDATE).
Implicit data type conversion can for example occur in the following cases:
MAIN
DEFINE v VARCHAR(50),
d DECIMAL(10,2)
LET v = 1234.50 * 2 -- 1.
LET d = v -- 2.
LET d = func(d) -- 3. and 4.
DISPLAY d -- 5.
END MAIN
FUNCTION func(v)
DEFINE v VARCHAR(50)
DISPLAY v
RETURN v -- 4.
END FUNCTION