This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v20 R7
Type conversions between collections and 4D arrays

Type conversions between collections and 4D arrays  


 

 

When moving values between arrays (typed) and collections (non-typed), 4D applies automatic conversions according to the values and the array type declarations. This section details type conversions from collections to arrays and conversely.

The following conversions are applied to values handled by the following commands:

Collection element typenullbooleanInfinityrealstringdatepictureobjectcollection4D.Blob
ARRAY TEXT"""false" or "true""Infinity"number with dot separator (if necessary)TextConversion of date in text according to Dates inside objects database parameter"[object Object]""[object Object]"Collection elements separated by ,"[object Object]"
ARRAY LONGINT00 or 1not defined behaviorrounded according to standard rounding rules0 if string does not start with [0-9,+,-,e,.,x], otherwise standard conversion. Supports hexa notation prefix 0x00000
ARRAY REAL00 or 1INFrealsame as ARRAY LONGINT00000
ARRAY INTEGER00 or 10rounded according to std rounding rulessame as ARRAY LONGINT00000
ARRAY BOOLEANFalsefalse or truetruetrue if #0true if string#""true if date#"00/00/00"TrueTrueTrueTrue
ARRAY OBJECTundefinedundefinedundefinedundefinedundefinedundefinedObject pictureObjectUndefined4D.Blob
ARRAY BLOB0 bytes0 bytes0 bytes0 bytes0 bytes0 bytes0 bytes0 bytes0 bytesBlob
ARRAY PICTURE0 bytes0 bytes0 bytes0 bytes0 bytes0 bytesPicture0 bytes0 bytes0 bytes
ARRAY DATE00/00/0000/00/0000/00/0000/00/0000/00/00 or a date if ISO8601 compliant formatdate00/00/0000/00/0000/00/0000/00/00
ARRAY TIME00:00:0000:00:00not defined behaviornumber of seconds in 00:00:00 formatnumber of seconds in 00:00:00 format00:00:0000:00:0000:00:0000:00:0000: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 TEXTARRAY LONGINTARRAY REALARRAY INTEGERARRAY BOOLEANARRAY OBJECTARRAY PICTUREARRAY DATEARRAY TIMEARRAY BLOB
Collection element typesstringnumbernumbernumberbooleanobject or nullpicturestring or date according to the Dates inside objects database parameternumber of seconds4D.Blob



See also 

ARRAY TO COLLECTION
COLLECTION TO ARRAY
OB GET ARRAY
OB SET ARRAY

 
PROPERTIES 

Product: 4D
Theme: Collections

 
PAGE CONTENTS 
 
HISTORY 

Modified: 4D v19 R2

 
ARTICLE USAGE

4D Language Reference ( 4D v20 R7)