FT Array Functions

 FT_AADDITION()   Add elements unique of source array to target array
 FT_AAVG()        Average numeric values in an array
 FT_ADESSORT()    Sort an array in descending order
 FT_AEMAXLEN()    Find longest element within an array
 FT_AEMINLEN()    Find shortest element within an array
 FT_AMEDIAN()     Find middle value in array, or average of two middle values
 FT_ANOMATCHES()  Find the number of array elements meeting a condition
 FT_AREDIT()      2 dimensional array editing function using TBrowse
 FT_ASUM()        Sum the elements of an array
 FT_RESTARR()     Restore a Clipper array from a disc file
 FT_SAVEARR()     Save Clipper array to a disc file.

 

FT_ANOMATCHES

FT_ANOMATCHES()
 Find the number of array elements meeting a condition

 Syntax

      FT_ANOMATCHES( <aArray>, <bCompareBlock> ;
                     [, <nStartIndex> [, <nEndIndex> ] ] ) -> nNoOfMatches

 Arguments

     <aArray> is the array to be searched

     <bCompareBlock> is a code block containing the expression for
     the array elements to be tested with.  Each element is passed
     as a parameter to the block.  If the block returns .T., the
     number of matches will be incremented by one.

     <nStartIndex> is the first array item to include in the search,
     defaults to first element.

     <nEndIndex> is the last array element to include in the search,
     defaults to all elements.

 Returns

     The number of elements that cause the code block to return .T.

 Description

     This function returns the number of array elements that, when passed
     to the supplied code block, cause that code block to return a .T. value.

 Examples

     // Search the Entire Array
     FT_ANOMATCHES(aTries, { | x | x <= 100 } )

     // Search from the 5th Element On
     FT_ANOMATCHES(aCodes, { | x | UPPER(x) == cCurrentCode }, 5)

     // Search the 1st 10 Elements
     FT_ANOMATCHES(aDates, { | x | IS_BETWEEN(DATE()-7,x,DATE() + 7) }, 10)

     // Search Elements 5-10
     FT_ANOMATCHES(aNames, { | x | x <= cLastGoodName }, 5, 10)

 Source: ANOMATCH.PRG

 Author: David Husnian