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 v6.11 - aofsetfilter() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 aofSetFilter()
 Creates a new system-owned Client Advantage Optimized Filter
------------------------------------------------------------------------------

Syntax

     aofSetFilter( [<cExpr>] ) -> NIL

     <cExpr>  Optional character expression containing the filter
     condition that records must meet in order to be included in the
     filter.

     If no parameter is specified, the existing system-owned filter is
     cleared.

Returns

     NIL

Description

     aofSetFilter() will create a system-owned Client Advantage Optimized
     Filter.  Any existing system-owned Client AOF will be destroyed.

     The aofSetFilter() function will be called by the SET FILTER TO
     command if the AOF.CH header file is included with your code.
     aofSetFilter() will isolate the records which meet a condition and
     make all non-matching records "invisible". If aofSetFilter() is
     invoked with no parameters, it is equivalent to invoking
     dbClearFilter().

     aofSetFilter() analyzes the condition and rapidly builds a bit-map
     of all records which meet the condition using available indexes.

     This bit-map is then used so that only records which actually meet
     the filter condition are actually accessed.

     It then does a SET FILTER TO of the given condition. The SET FILTER
     TO is done because in a multi-user environment, if the table
     is not explicitly locked by your application, the records can
     change. The SET FILTER TO insures that if a record which originally
     met the condition changes and no longer meets the condition, it
     becomes invisible.

     For the best possible performance you should have indexes created on
     all expressions referenced in the condition.

     Note:  Set the index order to zero (natural record order) before
     creating a filter with the aofSetFilter() function for best filter
     creation performance.

     If the new filter is not fully optimized, and the "Auto Resolve"
     setting is ON (see aofSetAutoResolve() for more information), then
     the filter will be automatically resolved into a fully-optimized
     filter.

     Note:  Advantage has support for creating and using Advantage
     Optimized Filters on the server as well as on the client.  AOF usage
     on the client is more flexible than AOF usage on the server, but AOF
     usage on the server is much faster than AOF usage on the client.  If
     you don't need the flexibility of a Client AOF, then you should look
     into using Server AOFs via AX_SetServerAOF() for superior performance.

Example

     USE Accounts INDEX state

     // Create a system-owned filter
     aofSetFilter( 'state == "CA"' )

     // List all records where state = 'CA'
     LIST state


See Also: AX_SetServerAOF() aofCreateFilter() aofGetAutoResolve() aofSetAutoResolve()

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