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

Home

 
4D v19.8
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 typenullbooleanInfinityrealstringdatepictureobjectcollection
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 ,
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 0x0000
ARRAY REAL00 or 1INFrealsame as ARRAY LONGINT0000
ARRAY INTEGER00 or 10rounded according to std rounding rulessame as ARRAY LONGINT0000
ARRAY BOOLEANFalsefalse or truetruetrue if #0true if string#""true if date#"00/00/00"TrueTrueTrue
ARRAY OBJECTundefinedundefinedundefinedundefinedundefinedundefinedObject pictureObjectUndefined
ARRAY PICTURE0 bytes0 bytes0 bytes0 bytes0 bytes0 bytesPicture0 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/00
ARRAY TIME00:00:0000:00:00not defined behaviornumber of secondsnumber of seconds00:00:0000:00:0000:00:0000:00:00

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

ARRAY TEXTARRAY LONGINTARRAY REALARRAY INTEGERARRAY BOOLEANARRAY OBJECTARRAY PICTUREARRAY DATEARRAY TIME
Collection element typesstringnumbernumbernumberbooleanobject or nullpicturestring or date according to the Dates inside objects database parameternumber of seconds



See also 

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

 
PROPERTIES 

Product: 4D
Theme: Collections

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)