Difference between revisions of "Constants and Expressions"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 1: | Line 1: | ||
==Constants== | ==Constants== | ||
The Recital/4GL supports the following constants: | The Recital/4GL supports the following constants: | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 15: | Line 16: | ||
|- | |- | ||
|} | |} | ||
+ | |||
====Hexadecimal numbers==== | ====Hexadecimal numbers==== | ||
Line 36: | Line 38: | ||
0x00000034 | 0x00000034 | ||
</code> | </code> | ||
+ | |||
==Expressions== | ==Expressions== | ||
The TYPE() function can be used to determine the data type of any expression. | The TYPE() function can be used to determine the data type of any expression. | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 75: | Line 79: | ||
|- | |- | ||
|} | |} | ||
+ | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Reference]] | [[Category:Reference]] |
Revision as of 13:12, 24 March 2009
Constants
The Recital/4GL supports the following constants:
Datatype | Description |
---|---|
Character | A string of ASCII characters up to 8191 characters in length.
Delimited by double quotes "", single quotes ’’ or square brackets [] |
Numeric | An integer number of up to 16 digits (0-9) or a floating point number of up to 25 digits (9 are reserved for decimal places) and one decimal point. |
Date | A combination of digits and separators delimited by curly braces {}. The format is determined by the SET DATE and SET CENTURY commands. |
Logical | A choice of two values, .T. for true, .F. for false |
Hexadecimal numbers
Hexadecimal numbers, prefixed by 0x, can be used in place of decimal numbers except in the data entry/modification of numerics. (Linux platforms only).
? BITAND(0x67452301,0xFFFFFFFF)
Results of expressions will still be returned as decimal numbers.
? 0x1a * 2 52
The TRANSFORM() function can be used to return a numeric as a hexadecimal.
? transform((0x1a * 2),"@0") 0x00000034
Expressions
The TYPE() function can be used to determine the data type of any expression.
uMemvar | TYPE("uMemvar") | Type |
---|---|---|
[hello] | ’C’ | Character |
’goodbye’ | ’C’ | Character |
"RECITAL" | ’C’ | Character |
1234 | ’N’ | Numeric |
1234.56 | ’N’ | Numeric |
"1234.56" | ’C’ | Character |
0x2b | ’N’ | Numeric |
{01/01/96} | ’D’ | Date |
{01/01/1996} | ’D’ | Date |
"01/01/96" | ’C’ | Character |
.T. | ’L’ | Logical |
.F. | ’L’ | Logical |
opentags | ’P’ | Procedure |
OMyObj | ’O’ | Object |
Undetermined Type | ’U’ | Undefined |