This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
Type conversions between collections and 4D arrays
|
Collection element type | null | boolean | Infinity | real | string | date | picture | object | collection | 4D.Blob |
ARRAY TEXT | "" | "false" or "true" | "Infinity" | number with dot separator (if necessary) | Text | Conversion of date in text according to Dates inside objects database parameter | "[object Object]" | "[object Object]" | Collection elements separated by , | "[object Object]" |
ARRAY LONGINT | 0 | 0 or 1 | not defined behavior | rounded according to standard rounding rules | 0 if string does not start with [0-9,+,-,e,.,x], otherwise standard conversion. Supports hexa notation prefix 0x | 0 | 0 | 0 | 0 | 0 |
ARRAY REAL | 0 | 0 or 1 | INF | real | same as ARRAY LONGINT | 0 | 0 | 0 | 0 | 0 |
ARRAY INTEGER | 0 | 0 or 1 | 0 | rounded according to std rounding rules | same as ARRAY LONGINT | 0 | 0 | 0 | 0 | 0 |
ARRAY BOOLEAN | False | false or true | true | true if #0 | true if string#"" | true if date#"00/00/00" | True | True | True | True |
ARRAY OBJECT | undefined | undefined | undefined | undefined | undefined | undefined | Object picture | Object | Undefined | 4D.Blob |
ARRAY BLOB | 0 bytes | 0 bytes | 0 bytes | 0 bytes | 0 bytes | 0 bytes | 0 bytes | 0 bytes | 0 bytes | Blob |
ARRAY PICTURE | 0 bytes | 0 bytes | 0 bytes | 0 bytes | 0 bytes | 0 bytes | Picture | 0 bytes | 0 bytes | 0 bytes |
ARRAY DATE | 00/00/00 | 00/00/00 | 00/00/00 | 00/00/00 | 00/00/00 or a date if ISO8601 compliant format | date | 00/00/00 | 00/00/00 | 00/00/00 | 00/00/00 |
ARRAY TIME | 00:00:00 | 00:00:00 | not defined behavior | number of seconds in 00:00:00 format | number of seconds in 00:00:00 format | 00:00:00 | 00:00:00 | 00:00:00 | 00:00:00 | 00:00:00 |
Note: Blob objects (4D.Blob) are automatically converted to scalar blobs and vice versa when necessary (see Automatic conversion of blob type on developer.4d.com).
The following conversions are applied to values handled by the following commands:
ARRAY TEXT | ARRAY LONGINT | ARRAY REAL | ARRAY INTEGER | ARRAY BOOLEAN | ARRAY OBJECT | ARRAY PICTURE | ARRAY DATE | ARRAY TIME | ARRAY BLOB | |
Collection element types | string | number | number | number | boolean | object or null | picture | string or date according to the Dates inside objects database parameter | number of seconds | 4D.Blob |
ARRAY TO COLLECTION
COLLECTION TO ARRAY
OB GET ARRAY
OB SET ARRAY
Product: 4D
Theme: Collections
Modified: 4D v19 R2
4D Language Reference ( 4D v20 R7)