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

3 responses to “FT_ANOMATCHES

  1. Pingback: FT Functions | Viva Clipper !

  2. Pingback: FT Array Functions | Viva Clipper !

  3. Pingback: NanForum Toolkit | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.