Function DbLocate() Foundation
Defines a condition for a sequential search and performs the search.
DbLocate( <bForCondition>, ; [<bWhileCondition>], ; [<nCount>], ; [<xRecordID>], ; [<lRest>] ) --> lFound
The return value of DbLocate() is a logical value indicating whether a record matching the search condition <bForCondition> was found. It is identical in meaning to the return value of Found().
The function DbLocate() defines a search condition for a work area and executes the first search operation. It performs a sequential search, meaning the record pointer is moved sequentially to the next record until the code block <bForCondition> returns the value .T. (true) indicating a matching record. If a matching record is found, the function Found() also returns the value .T. (until the record pointer is moved by some other operation).
The search condition <bForCondition> remains set in the work area and the search can be continued after termination of DbLocate() with the function DbContinue(). As soon as the end of the file is reached, the search terminates.
If the records searched are not limited by additional parameters, the search begins with the first logical record in the work area. Data records flagged as deleted are not included in the search if SET DELETED is turned ON. When a filter condition is active in the work area, filtered records are also ignored in the search.
If DbLocate() is called without the alias operator, the search is performed in the current work area. This is identical with the operation of the command LOCATE.
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.