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

  •  
 
4D v19.8
collection.length

collection.length 


 

   
Parameter Type   Description
collection.length   Longint in Number of elements in the collection

The collection.length property returns the number of elements in the collection.

The collection.length property is initialized when the collection is created. Adding or removing elements updates the length, if necessary. This property is read-only (you cannot use it to set the size of the collection).

Example  

 C_COLLECTION($col//$col.length initialized to 0
 $col:=New collection("one";"two";"three") //$col.length updated to 3
 $col[4]:="five" //$col.length updated to 5
 $vSize:=$col.remove(0;3).length //$vSize=2



See also 

collection.count( )
collection.resize( )