4D v14.3

Count in array

Home

 
4D v14.3
Count in array

Count in array 


 

Count in array ( array ; value ) -> Function result 
Parameter Type   Description
array  Array in Array where count should occur
value  Expression in Value to count
Function result  Longint in Number of instances found

The Count in array command returns the number of times value is found in array.

This command can be used with the following array types: Text, Alpha, number, Date, Pointer and Boolean. The array and value parameters must be the same type or compatible.

If no element in array matches value, the command returns 0.

Example  

The following example allows displaying the number of selected lines in a list box:

  //tBList is the name of a List box column array
 ALERT(String(Count in array(tBList;True))+" line(s) selected in the list box")

 
PROPERTIES 

Product: 4D
Theme: Arrays
Number: 907

 
HISTORY 

Created: 4D 2004

 
SEE ALSO 

Find in array

 
ARTICLE USAGE

4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)

Parent of : Count in array ( 4D v14 R4)