Command FIND Foundation

Finds a character expression in the controlling index.

Syntax
FIND <cSeekString>
Parameters
<cSeekString>
<cSeekString> is a character expression searched for in the controlling index of the current work area. The expression can be specified as a literal or as a character expression in parentheses.
Description

The file command FIND exists only for compatibility reasons. The command SEEK or the function DbSeek() should be used instead of FIND. FIND processes only character expressions. If the key value of the controlling index is not a character expression, a runtime error occurs.

When the character expression is found in the index, the record pointer in the current work area is positioned on the corresponding record and Found() returns the value .T. (true). If the search is not successful, and SOFTSEEK is turned ON, the record pointer is positioned on the record with the next higher value in the index and Found() returns .F. (false). If SOFTSEEK is turned OFF and the search is not successful, the record pointer is moved to the end of file, the function Eof() returns .T. (true), and the function Found() returns the value .F. (false).

Examples
FIND
// The example shows different ways to call FIND. 

PROCEDURE Main 

   USE Customer NEW 
   INDEX ON Upper(LName+FName) TO CustA 

   FIND MILLER 
   ? Found(), Eof()                  // result: .T. .F. 

   FIND Miller 
   ? Found(), Eof()                  // result: .F. .T. 

   FIND ("ANDERSON") 
   ? Found(), Eof()                  // result: .T. .F. 

   FIND "XYZ" 
   ? Found(), Eof()                  // result: .F. .T. 

   CLOSE 
RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.