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 - aofcountrecords() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 aofCountRecords()
 Returns the number of records in a Client Advantage Optimized Filter
------------------------------------------------------------------------------

Syntax

     aofCountRecords( [<nHandle>] ) -> numeric

     <nHandle>  Optional handle to an existing filter. If a handle is
     specified, then aofCountRecords() returns the number of records in the
     specified user-owned filter. If no handle is passed, then
     aofCountRecords() returns the number of records in the system-owned
     filter.

Returns
     Returns the number of records in either a user-owned or a
     system-owned optimized filter.

Description

     aofCountRecords() returns the number of records which meet the
     filter condition for a system-owned or a user-owned filter.

     aofCountRecords() will only return the number of records which meet
     the filter condition.  aofCountRecords() does not obey an active
     index scope. aofKeyCount() should be used to get the number of
     records which meet the filter condition and which fall within the
     index scope.

     Note:  When aofCountRecords() is performed on a system-owned filter,
     and if that filter is only partially optimized, then the filter will be
     automatically resolved into a fully optimized filter before the
     actual count record operation takes place. This is to ensure an
     accurate record count is returned.

     Note:  Filtering deleted records (SET DELETED ON) without an index
     built on "DELETED()" will have no effect on the optimization level.
     In other words, if the rest of the expression is fully optimized then
     the optimization level returned via aofGetOptLevel() will still be
     fully optimized. In this case, aofCountRecords() returns the number of
     records including the deleted records. To remove deleted records from
     and aofCountRecords(), there must be an index built on "DELETED()".

Example

     // Create a system-owned optimized filter
     aofSetFilter( "lastname > 'Smith'" )

     // Create a user-owned optimized filter
     nHandle1 := aofCreateFilter( "state == 'CA'" )

     // Get the number of records for the system-owned filter, which is
     // the number of people with lastname > 'Smith'
     ? aofCountRecords()

     // Get the number of records for the user-owned filter, which is
     // the number of people who live in California.
     ? aofCountRecords( nHandle1 )

     // Free the user-owned filter
     aofFreeFilter( nHandle1 )


See Also: aofKeyCount()

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