Difference between revisions of "Constants and Expressions"
From Recital Documentation Wiki
		
		
		
Yvonnemilne  (Talk | contribs)  | 
				Yvonnemilne  (Talk | contribs)   | 
				||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
==Constants==  | ==Constants==  | ||
| − | + | Recital supports the following constants:  | |
| Line 6: | Line 6: | ||
!Datatype||Description  | !Datatype||Description  | ||
|-  | |-  | ||
| − | |Character||A string of ASCII characters up to   | + | |Character||A string of ASCII characters up to 65535 characters in length. Delimited by double quotes "", single quotes ‘’ or square brackets []  | 
| − | Delimited by double quotes "", single quotes   | + | |
|-  | |-  | ||
|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.  | |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.  | ||
| Line 13: | Line 12: | ||
|Date||A combination of digits and separators delimited by curly braces {}.  The format is determined by the SET DATE and SET CENTURY commands.  | |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  | + | |Logical||A choice of two values,  .T. for true, .F. for false (true and false can also be used themselves)  | 
|-  | |-  | ||
|}  | |}  | ||
| Line 20: | Line 19: | ||
====Hexadecimal numbers====  | ====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).  | Hexadecimal numbers, prefixed by 0x, can be used in place of decimal numbers except in the data entry/modification of numerics. (Linux platforms only).  | ||
| + | |||
<code lang="recital">  | <code lang="recital">  | ||
? BITAND(0x67452301,0xFFFFFFFF)  | ? BITAND(0x67452301,0xFFFFFFFF)  | ||
</code>  | </code>  | ||
| + | |||
Results of expressions will still be returned as decimal numbers.  | Results of expressions will still be returned as decimal numbers.  | ||
| + | |||
<code lang="recital">  | <code lang="recital">  | ||
| Line 32: | Line 34: | ||
</code>  | </code>  | ||
| − | The TRANSFORM() function can be used to return a numeric as a hexadecimal.    | + | |
| + | The [[TRANSFORM()]] function can be used to return a numeric as a hexadecimal.    | ||
| + | |||
<code lang="recital">  | <code lang="recital">  | ||
| Line 38: | Line 42: | ||
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.  | 
Latest revision as of 11:25, 3 September 2010
Constants
Recital supports the following constants:
| Datatype | Description | 
|---|---|
| Character | A string of ASCII characters up to 65535 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 (true and false can also be used themselves) | 
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 |