Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- ClipOn 3.0 Reference - c_search() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 C_SEARCH()

 DESCRIPTION

 The C_SEARCH() function fills the specified Clipper array with
 record numbers matching the expression specified.  Up to 2048
 record numbers can be filled in the array and deleted records can
 be automatically excluded or included.

 SYNTAX

 C_SEARCH(expr [,array_name] [,index] [,maxrecs] [,deletes])

 PARAMETERS

 expr (C) is the character expression to evaluate for each record
 checked in the database to determine if it should be included in
 the array.

 array_name (C) is the name of the Clipper array to store the record
 numbers that match the search expression.  C_SEARCH() declares
 array_name to be a public array for the correct size needed for the
 record numbers.  If array_name is not specified, C_SEARCH() only
 returns the number of matching records found.

 index (L) indicates whether or not an index file is active and
 should be used to speed the search.  Specify true (.T.) if an index
 is in use by the database and is indexed by the search expression.
 A SEEK must be done before calling C_SEARCH() to position at the
 first record matching the search expression.  The search will end
 when a record is found not matching the search expression.  Note
 that using an index is the fastest method for executing C_SEARCH().
 If index is not specified, the default of false (.F.) is used.

 maxrecs (N) is the maximum number of records (1 to 2048) to fill in
 the array.  If maxrecs is not specified, the default of 2048 is
 used.

 deletes (L) indicates whether deleted records should be included or
 excluded from the search.  Specify true (.T.) to include deleted
 records in the search, or false (.F.) to exclude deleted records.
 If the deletes argument is not specified, deleted records are
 excluded (.F.) from the search.

 RETURNS

 C_SEARCH() returns the number of records found matching the search
 expression.

 EXAMPLES

 use test index test

 seek "VA"              && Use index for fastest method.
 if found()             && Seek to first record for 'VA'.
   c_search("State = 'VA'", "recarr", .t.)    && Get record numbers for
 endif                                        && state = 'VA' into "recarr"

 c_search("", "recarr")             && Get all records into "recarr"

 c_search("deleted()","recarr",.f.,"",.t.)    && Get all deleted records


See Also: C_ASEARCH()

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