4D v18

collection.count( )

Home

 
4D v18
collection.count( )

collection.count( )  


 

Die Funktion collection.count( ) gibt die Anzahl der nicht-null Elemente in der Collection zurück.

Enthält die Collection Objekte, können Sie den Parameter EigenschaftsPfad übergeben. Dann werden nur die Elemente mit dem EigenschaftsPtad berücksichtigt.

 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



Siehe auch 

collection.length

 
EIGENSCHAFTEN 

Produkt: 4D
Thema: Collections

Dieser Befehl kann in preemptive Prozessen laufen

 
SEITENINHALT 
 
GESCHICHTE 

 
ARTIKELVERWENDUNG

4D Programmiersprache ( 4D v18)