LOCATE Command
Sequentially searches the table for the first record that matches the specified logical expression.
LOCATE [FOR lExpression1] [Scope] [WHILE lExpression2] [NOOPTIMIZE] |
Parameters
- FOR lExpression1
-
Sequentially searches the current table for the first record that matches the logical expression lExpression1.
Rushmore Query Optimization optimizes a query created with LOCATE FOR if lExpression1 is an optimizable expression. For best performance, use an optimizable expression in the FOR clause.
For more information, see SET OPTIMIZE Command and Using Rushmore Query Optimization to Speed Data Access.
- Scope
-
Specifies a range of records to locate. Only the records that fall within the range are located. The scope clauses are: ALL, NEXT nRecords, RECORD nRecordNumber, and REST. Commands that include Scope operate only on the table in the active work area.
The default scope for LOCATE is ALL records.
- WHILE lExpression2
-
Specifies a condition whereby records are searched for as long as the logical expression lExpression2 evaluates to true (.T.).
- NOOPTIMIZE
-
Disables Rushmore Query Optimization of LOCATE.
For more information, see SET OPTIMIZE Command and Using Rushmore Query Optimization to Speed Data Access.
Remarks
Example
See Also
© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic
Microsoft Visual FoxPro 9 SP2 Help file, VFPX Edition v1.08