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 - aofdbeval() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 aofDbEval()
 Optimized version of dbEval functions with FOR conditions
------------------------------------------------------------------------------

Syntax

     aofDbEval( <bEvalBlock>, <cForExpr>, <bForBlock> ) -> NIL

     <bEvalBlock>  Code block to be evaluated.

     <cForExpr>  FOR criteria as a string.

     <bForBlock>  FOR criteria as a code block.

     Note:  FOR criteria must be passed in both character and code
     block form. If an expression is deemed non-optimizable, <bEvalBlock>
     and <bForBlock> will be passed on to CA-Clipper's dbEval() for
     evaluation.

Returns

     NIL

Description

     aofDbEval() performs an optimized scan of the table
     evaluating a code block based on records that meet the FOR criteria.

Example

     LOCAL bEval := { || NIL }, cFor, bFor

     USE Salesmen INDEX Sales

     // Set up the parameters
     bEval := { || bonus += 1000.00 }
     cFor  := "sales > 25000"
     bFor  := { || sales > 25000 }

     // Give them a bonus
     aofDbEval( bEval, cFor, bFor )




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