Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Advantage CA-Clipper Guide v5.5 - aofandfilter() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 aofAndFilter()
 Logically AND's the records in two Client Advantage Optimized Filters
------------------------------------------------------------------------------

Syntax

     aofAndFilter( <nHandle1>, <nHandle2> ) -> logical

     <nHandle1>  Handle to first user-owned filter.

     <nHandle2>  Handle to second user-owned filter.

Returns

     Returns .T. if the operation was successful; .F. indicates it failed.
     If aofAndFilter() failed, aofErrorCode() will return information on
     why the function failed.

Description

     aofAndFilter() logically AND's together two user-owned filters so
     that only records contained in both user-owned filters are contained
     in the result.

     The second filter specified, nHandle2, is destroyed by this function.
     The first user-owned filter specified, nHandle1, will contain the
     result of the AND'd filters.

Example

     // Create two new empty, user-owned optimized filters
     nHandle1 := aofCreateFilter()
     nHandle2 := aofCreateFilter()

     // Add records 5, 10, and 15 to filter 1
     aofAddRecord( nHandle1, 5 )
     aofAddRecord( nHandle1, 10 )
     aofAddRecord( nHandle1, 15 )

     // Add records 10 and 25 to filter 2
     aofAddRecord( nHandle2, 10 )
     aofAddRecord( nHandle2, 25 )

     ? aofCountRecords( nHandle1 )    // returns 3
     ? aofCountRecords( nHandle2 )    // returns 2

     // Logically AND the two filters together.  The resulting
     // filter will be in nHandle1 and the filter nHandle2 will
     // be automatically destroyed by this operation.
     // The resulting filter, nHandle1, will contain record 10 only.
     aofAndFilter( nHandle1, nHandle2 )

     ? aofCountRecords( nHandle1 )    // returns 1

     // Free first user-owned filter
     // Note that second filter was automatically destroyed
     // by aofAndFilter()
     aofFreeFilter( nHandle1 )


See Also: aofOrFilter() aofNotFilter()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson