Count in array

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 2004


Count in array (array; value) Longint

ParameterTypeDescription
arrayArrayArray where count should occur
valueExpressionValue to count
Function resultLongintNumber of instances found

Description

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")

See Also

Find in array.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next