Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>find</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
FIND


Syntax:     FIND <character string>/(<expC>)

Purpose:    To search an index for the first key matching the specified
            character string and position the record pointer to the
            corresponding record.

Argument:   <character string> is all or part of the index key of a
            record you are searching for.  If an expression (<expC>) is
            specified instead of a literal character string, FIND
            operates the same as SEEK.

Usage:      FIND searches the controlling index starting with the first
            key and proceeds until a match is found or there is a key
            value greater than the search argument.  If there is a
            match, the record pointer is positioned to the record number
            found in the index.  If SOFTSEEK is OFF (the default) and
            FIND does not find a record, the record pointer is
            positioned to LASTREC() + 1, EOF() returns true (.T.), and
            FOUND() returns false (.F.).  If SOFTSEEK is ON, the record
            pointer is positioned to the record with the first key value
            greater than the search argument and FOUND() returns false
            (.F.).  In this case, EOF() only returns true (.T.) if there
            are no keys in the index greater than the search argument.

            EXACT: Note that FIND is not affected by SET EXACT.

            Leading blanks: If a literal search argument has leading
            blanks, it must be delimited with quote marks and have the
            same number of leading blanks as the index key.

            Macro substitution: The search argument can be a macro
            variable if not bounded by parentheses.  The syntax for this
            is &<memvar>.

            Numeric keys: Clipper stores numeric index keys with
            leading zeros.  This means that to FIND a numeric key with a
            literal search argument, you must pad it with leading zeros
            so there are as many digits in the search argument as there
            are whole number digits in the index key.  The number of
            decimal digits does not matter unless the number contains
            decimal values other than zero.

Library:    CLIPPER.LIB


----------------------------------- Examples -------------------------------

   USE Sales INDEX Branch
   ? LASTREC()                      && Result: 84
   ? INDEXKEY()                     && Result: BRANCH

   FIND 200
   ? FOUND(), EOF(), RECNO()        && Result: .T. .F. 5

   FIND 500
   ? FOUND(), EOF(), RECNO()        && Result: .F. .T. 85

   string = "200"
   FIND &string.
   ? FOUND(), EOF(), RECNO()        && Result: .T. .F. 5

   FIND "100"
   ? FOUND(), EOF(), RECNO()        && Result: .T. .F. 1


See Also: INDEX SEEK SET SOFTSEEK EOF() FOUND()

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