RDD

DbLocate()

Search sequentially for a matching record

Syntax

Signature
DbLocate( [bForCondition], [bWhileCondition], [nNextRecords], [nRecord], [lRest] ) --> NIL

Arguments

bForCondition

Match block. bWhileCondition Stop block.

nNextRecords

, nRecord, lRest Limit the search scope.

Return value

NIL. FOUND() reports whether a matching record was found.

Description

DbLocate() scans records in the current work area until the FOR condition succeeds or the selected scope ends. On success, the matching record becomes current.

Notes

DbContinue() resumes a locate search after the current match.

Example

DbLocate.prg
PROCEDURE Main()

   DbUseArea( .T., , "people.dbf", "People" )
   DbLocate( {|| FIELD->NAME == "Anna" } )
   QOut( Found() )
   DbCloseArea()

   RETURN

Output

See also