Home
The collection.count( ) method returns the number of non-null elements in the collection.
If the collection contains objects, you can pass the propertyPath parameter. In this case, only elements that contain the propertyPath are taken into account.
C_COLLECTION($col) C_REAL($count1;$count2) $col:=New collection(20;30;Null;40) $col.push(New object("name";"Smith";"salary";10000)) $col.push(New object("name";"Wesson";"salary";50000)) $col.push(New object("name";"Gross";"salary";10500)) $col.push(New object("lastName";"Henry";"salary";12000)) $count1:=$col.count() //$count1=7 $count2:=$col.count("name") //$count2=3
collection.length
Product: 4D Theme: Collections
4D Language Reference ( 4D v17) 4D Language Reference ( 4D v17.1) 4D Language Reference ( 4D v17.2) 4D Language Reference ( 4D v17.3) 4D Language Reference ( 4D v17.4)