CountSubset (GenericNamedArraylist function)
[Introduced in Sirius Mods 7.8]
The CountSubset function returns the number of items in a collection that match a specified selection criterion. It is related to the SubsetNew collection method, which returns not the count but a collection of the matching items for a specified criterion.
%number = anyNal:CountSubset( selectionCriterion)
|A numeric variable to contain the count of matching items.
|A NamedArraylist, FloatNamedArraylist, or UnicodeNamedArraylist object variable.
|A SelectionCriterion object, which is a relational expression that is applied to each collection item value to determine whether the value satisfies the expression.
For more information about the function in the criterion, see "Specifying a SelectionCriterion's parameters".
- A CountSubset call with a particular selection criterion is equivalent to a count of the items in the subset returned by the SubsetNew method with that criterion.
For the collection whose items are the odd integers between 0 and 10, and the selection criterion
LT(this, 9)), CountSubset returns