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 - aofresolvepartial() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 aofResolvePartial()
 Turns a partially optimized Client Advantage Optimized Filter into a fully
 optimized Client Advantage Optimized Filter
------------------------------------------------------------------------------

Syntax

     aofResolvePartial( [<nHandle>, <bExprBlock>] ) -> numeric

     <nHandle>  Optional handle to a user-owned filter. If this
     parameter is specified, then <bExprBlock> must be specified as well.

     <bExprBlock>  Optional code block that will be evaluated against
     each record set in the user-owned filter. The code block must
     evaluate to a logical value. If this parameter is specified, then
     <nHandle> must be specified as well.

     If no parameters are passed, then the system-owned filter will be
     resolved into a fully optimized filter.

Returns

     The number of records in the filter that were processed.

Description

     aofResolvePartial() visits all records in a partially optimized
     filter and converts the filter into a fully optimized filter.

     If the filter is a user-owned filter, then the handle to that filter
     and a code block to evaluate against each record in the filter must
     be passed to the aofResolvePartial() function. aofResolvePartial()
     will visit all records in the user-owned filter and evaluate the
     specified code block. If the code block evaluates to .F., the record
     will be removed from the user-owned filter. If the code block
     evaluates to .T., the record will remain in the filter.

     If the filter is a system-owned filter, then no parameters should be
     passed to the aofResolvePartial() function. aofResolvePartial() will
     visit all records in the system-owned filter and evaluate the
     existing filter condition. If the filter condition evaluates to .F.,
     the record will be removed from the system-owned filter. If the
     filter condition evaluates to .T., the record will remain in the
     filter.

     Note:  This function may be somewhat time consuming as each record
     in the filter must be read and evaluated against the code block.

Example

     USE Customer INDEX state

     // Create a user-owned filter
     nHandle := aofCreateFilter( 'state = "CA" .and. age = 25' )

     // Is the filter partially optimizable?
     if ( aofHasPartials( nHandle ) )

        // Evaluate filter against non-indexed expression
        aofResolvePartial( nHandle, { || state = "CA" .and. age = 25 } )

     endif

     aofFreeFilter( nHandle )


See Also: aofSetAutoResolve() aofGetAutoResolve() aofHasPartials()

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