Searches an indexed table for the first occurrence of a record whose index key matches a specified expression. Issuing SEEK( ) is equivalent to issuing SEEK and FOUND( ) in succession.

NoteNote

Visual FoxPro does not support seek operations for binary indexes.

SEEK(eExpression [, nWorkArea | cTableAlias
   [, nIndexNumber | cIDXIndexFileName | cTagName]])

Parameters

eExpression

Specifies the index key expression for which you want SEEK( ) to search.

nWorkArea

Specifies the work area number of the table that is searched for the index key.

cTableAlias

Specifies the alias of the table that is searched.

If you omit nWorkArea and cTableAlias, the table in the currently selected work area is searched.

nIndexNumber

Specifies the number of the index file or tag that is used to search for the index key. nIndexNumber refers to the index files as they are listed in USE or SET INDEX. Open .idx files are numbered first in the order in which they appear in USE or SET INDEX. Tags in the structural .cdx file (if one exists) are then numbered in the order in which they were created. Finally, tags in any open independent .cdx files are numbered in the order in which they were created. For more information about index numbering, see SET ORDER Command.

cIDXIndexFileName

Specifies an .idx file that is used to search for the index key.

cTagName

Specifies a tag of a .cdx file that is used to search for the index key. The tag name can be from a structural .cdx file or any open independent .cdx file.

NoteNote

The .idx file takes precedence if duplicate .idx file and tag names exist.

Expand imageReturn Value

Expand imageRemarks

Expand imageExample

Expand imageSee Also