Constants and Expressions

From Recital Documentation Wiki
Revision as of 13:10, 24 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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