Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>set typecheck:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  SET TYPECHECK:

  Syntax:

  SET TYPECHECK ON/OFF/<lExp>

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

  OFF overrides the default type checking.

  <xlToggle> is a logical expression that must be enclosed in parentheses.
  A value of true (.T.) is the same as ON, and a value of false (.F.) is
  the same as OFF.

  Description:

  The SET TYPECHECK command is used to toggle ON or OFF the forced
  validation of query conditions before an optimizable command or
  function is processed.   Type checking is always enforced with
  m6_IsOptimize() and cannot be disabled.  Any errors detected by MachSIx
  in the query condition will be reported through the m6_Error()
  function.

  Performance Tip: 

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

  ---------------------------------| EXAMPLE |--------------------------------
  /*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  *  Demonstrates the SET TYPECHECK command                                 *
  *::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/

  #include "SIXCDX.CH"
  #include "MACHSIX.CH"

  Local nCount, cCond

  USE Account VIA "SIXCDX"  // Assume structural index ACCOUNT.CDX opened
                            // automatically and contains tags State and
                            // Age
  CLEAR SCREEN

  ? "Example of SET TYPECHECK command."
  ?

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

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

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

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


See Also: m6_Error()

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