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>cftsveri( <cftshandle>, <expc1>, <expc2>, <expn> )</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   CftsVeri( <CFTShandle>, <expC1>, <expC2>, <expN> )

       Purpose

   Verify a target string against the .DBF source string.

       Parameters

   <CFTShandle> is a CFTS handle returned from CftsOpen().

   <expC1> is the source string to be verified (the source string is 
   usually the string that was passed to create the index).

   <expC2> is the target string against which the source string is 
   verified (the target string is the string being searched for).

   <expN> is the type of verification to be performed.

       Return Value

   CftsVeri() returns a 1 if the source is verified or a 0 if it is 
   not. An error is returned if you pass the function a bad handle, the 
   incorrect number of parameters, or the wrong type of parameters.

       Errors Returned

   -16   (BADPARMS): Illegal number of type or parameters

   -17   (NOMOREHANDLES): Ran out of CFTS handles

   -18   (BADHANDLE): Invalid handle was passed to the function.

       Comments

   Besides eliminating the need, in most cases, for programmers to 
   supply their own verification function, CftsVeri() properly applies 
   the CASE FLAG and FILTER NUM conditions established for a CFTS index 
   when it was created. This eliminates, for example, the need to have 
   the application apply case conversions or worry about handling 
   characters that have the eighth bit set.

   Four verification types are supported in this release: a strict 
   comparison at the beginning of the source; a strict comparison at the 
   end of the source; a logical AND, in which one or more target tokens 
   are compared against the source; and a strict comparison on multiple 
   tokens.

   Each verification type is associated with a numerical value:
   1 -> verify only at beginning of source string
   2 -> verify only at end of source string
   3 -> perform logical AND on one or more tokens
   4 -> do not AND one or more tokens

   In almost all cases, type 3 will give the most useful results. 
   Examine the Verify menu choice in the Bib demo program. It will allow 
   you to experiment with the different types.

   The tokens processed by CftsVeri() consist of consecutive runs of 
   characters and are usually words. Tokens are separated by tabs or 
   spaces. For example, the string: The quick brown fox consists of four 
   tokens.

   Using verification type 1 ( verify at beginning ) the following 
   targets would verify on our sample string:

   the
   he quick
   the quick b

   Using verification type 2 ( verify at end ) successful targets 
   would be:

   ox
   n fox
   wn fox
   and so on.

   Using verification type 3 (perform logical AND on one or more 
   tokens) your options expand. For example, all of these targets would 
   verify.

   fox
   the fox
   brown qui
   fo brown
   brown the
   th qu br fo

   Use verification type 4 (do not AND one or more tokens) when you 
   need to verify one or more tokens in order, as in the following:

   he quick bro
   brown fox
   quick brow
   the quick brown fox

   CftsVeri() provides an easy and flexible way to verify CftsNext() 
   returns. It is not, however, the fastest way to do it. The Clipper 
   AT() function can be used as well as other third party library 
   functions. Here again, if speed is the primary concern, testing a 
   variety of techniques should yield the best results.

       Example

   .
   .
   .
   use sales
   xhandle = CftsOpen( sales.ia, 20, .T. )
   tstring = "Smith" + "Bob"
   result = CftsSet( xhandle, tstring)     && set up search criteria
   if result <1
       ? error in CftsSet()
   endif
   result = CftsNext( xhandle )  && get the first hit
   do while result > 0           && get the rest of the hits
       goto result               && get record in .DBF
           fstring = trim(fname) + trim(lname)
           if CftsVeri( xhandle, fstring, tstring, 3 ) = 1
               ? "Verified: " + fstring
           endif
       result = CftsNext( xhandle )
   enddo
   .
   .
   .

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