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>cftsset( <cftshandle>, <expc> )</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   CftsSet( <CFTShandle>, <expC> )

       Purpose

   Used in conjunction with CftsNext() and CftsVeri(), this is the 
   first function called when performing a find operation. The function 
   takes the handle of a CFTS index file as well as the text to be 
   searched for as input. CftsSet() does not perform the search. It only 
   sets up the parameters. 1 is returned if successful, otherwise an 
   error code is returned.

       Parameters

    <CFTShandle> is an integer referring to a CFTS index.

   <expC> is a string containing the search criteria. Each sub-string 
   to be searched for should be separated by blanks (it is not necessary 
   to pad the front and back of the string with blanks). For example, the 
   string "ed cat" would match all records in the index containing both 
   "ed" and "cat" within them. Since it is a sub-string match, both "ed 
   has a cat" and "The catalog was spray painted" would be valid matches. 
   The order of the substrings in the search criteria is not important. 
   For a successful match, all substrings in the search criteria must be 
   present in the original indexed string.

       Return Value

   1 if successful, error code if not.

       Errors Returned

    -4   (BADSEEK): Error while attempting seek.

   -13   (NORECS): There are no records currently indexed. A search 
                   of the index (CftsNext()) would be fruitless.
   -16   (BADPARMS): Invalid parameters were passed to the function.
   -18   (BADHANDLE): Invalid handle was passed to the function.

       Comments

   It is acceptable to make other CFTS calls between CftsSet() and  
   CftsNext() and/or between CftsNext() calls. However, remember that if 
   a record is edited and saved (CftsReplac()ed) it may not still be a 
   qualified member of the verified hits. If a search is to be abandoned 
   midstream, other CFTS calls may be made without first completing the 
   search. The BIB.PRG demonstrates how you can start a search, edit and 
   save one of the hits, and then continue the search.

       Example

   .
   .
   .
   use sales
   xhandle = CftsOpen( 'sales.ia', 20, .T. )
   searchstr = 'Smith, Bob'
   result = CftsSet( xhandle, srchstring)  && set up search criteria
   if result <1
        ? 'error in CftsSet()'
   endif
   .
   .
   .

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