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 - set typecheck http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SET TYPECHECK
 Enable or disable Client Advantage Optimized Filter FOR clause syntax
 checking
------------------------------------------------------------------------------

 Syntax

     SET TYPECHECK ON | off

     ON forces the entire filter expression of a pending optimizable
     command or function to be tested for syntatical and data type
     correctness.  This is the default.

     OFF overrides the default type checking.

 Description

     The SET TYPECHECK command is used to toggle ON or OFF the forced
     validation of filter conditions before an optimizable command or
     function is processed.  Type checking is always enforced with
     aofIsOptimizable() and cannot be disabled.  Any errors detected by
     the Client Advantage Optimized Filters in the filter condition will be
     reported through the aofErrorCode() function.

     Note:  SET TYPECHECK to OFF if you always call aofIsOptimizable()
     to validate a filter before executing an optimizable command or
     function.  This will increase performance by eliminating the
     redundancy of type checking the filter condition twice.

     Note:  SET TYPECHECK is a Client Advantage Optimized Filter command.
     The command is only available if you link the Client Advantage Optimized
     Filter library, AOF.LIB, into your application and you #include the
     AOF.CH header file in your source code.

 Example

     // Must include AOF.CH in your source code to make the SET TYPECHECK
     //   command available.
     #include "AOF.CH"

     LOCAL nCount, nCond

     // Assume structural index ACCOUNT.CDX opened automatically and
     // contains tags State and Age
     USE account VIA "DBFCDXAX"

     ? "Example of SET TYPECHECK command."
     ?

     // Set type checking off to eliminate validating the filter
     // condition twice
     SET TYPECHECK OFF

     // Store a filter condition to cCond
     cCond := "State = 'CA' .and. Age > 25"

     // Test optimization level, type checking occurs here
     ? "aofIsOptimizable() = "
     ?? aofIsOptimizable( cCond )     // 2

     // Count records.  No type checking because of SET TYPECHECK is OFF.
     COUNT TO nCount FOR ( cCond )


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