Implicit Data Types of Literals
Documentation | Blog | Demos | Support
Implicit Data Types of Literals
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
Literals express values outside of pre-defined application objects. Because literals have no definition in the Object Dictionary, the software assumes a data type for each literal. This implicit data type is determined based on the characters contained in the value, and on whether or not the value is enclosed in quotation marks.
Literals that are enclosed in quotation marks, or that are unquoted but contain letters, are assumed to be character strings. Character strings are always implicitly CHAR.
Unquoted literal values that contain only digits, or digits and a decimal point are assumed to be numbers. Number literals are always implicitly VASTINT.
Constants (literals defined as objects, with names, in the Object Dictionary) can be assigned either the CHAR or VASTINT data type. No other type is permitted. The assigned data type overrides the data type implicit in the value of the constant.
Examples of Implicit Data Types
1234 | Is implicitly VASTINT. |
abcd | Is implicitly CHAR. |
2.6 | Is implicitly VASTINT. |
a1b2 | Is implicitly CHAR. |
‘1234’ | Is implicitly CHAR. |
‘ abcd’ | Is implicitly CHAR. |
‘-2.6’ | Is implicitly CHAR. |
‘a1b1’ | Is implicitly CHAR. |
See Also
Data Types and Storage of Values
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |