Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FAST TEXT SEARCH for Clipper v.2.0 - <b>debugging - fixing it</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   Debugging  - Fixing It

   Use of CFTS can generally be broken into three main parts: Building 
   the index, searching the index, and verifying the index returns. If 
   problems arise, the CFTS related code should be examined in that 
   order. Examine the SHOW1.PRG as a simple example of correct CFTS logic.

   To build a valid CFTS index you should make sure that the string 
   passed to CftsAdd() is in fact a string (no numeric types), trim the 
   string right before passing it to CftsAdd() or Cfts_Index(), set order 
   to 0 (so the index is built in the natural order of the primary .DBF) 
   and set deleted off (so deleted records are included). The CFTS index 
   file should contain one record for each record in the primary .DBF. 
   The number of records in a CFTS index can be calculated like this:

         number of records = (file size - 512)/index key size
         ex. 1000 = (32512 - 512)/32

   Note: UltraSearch can be used to generate a valid index file for 
   purposes of testing. UltraSearch can be purchased directly from Index 
   Applications. A shareware version is available from a variety of 
   sources including PCSIG.

   On the search side, first determine if CftsNext() is returning valid 
   numbers. If not, and you have determined that the index file is good, 
   examine the code that gets the search string and passes it to 
   CftsSet(). Remember to trim it right before CftsSet().

   If CftsNext() is returning good values, then examine the verification 
   procedure. Be sure the source and target strings are constructed 
   properly. Check again that the index was built in natural order and 
   that it contains entries for all the .DBF records. When this is not 
   the case, the number returned by CftsNext() will not correspond the 
   correct record number, CftsVeri() will receive the source string from 
   the wrong record and the it will only satisfy the verification process 
   by coincidence.


See Also: SHOW1.PRG

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