Searches a table for the first occurrence of a record whose index key matches a general expression, then moves the record pointer to the matching record.

NoteNote

Visual FoxPro does not support seek operations for binary indexes.

SEEK eExpression   [ORDER nIndexNumber | IDXIndexFileName
    | [TAG] TagName [OF CDXFileName]    [ASCENDING | DESCENDING]]
   [IN nWorkArea | cTableAlias]

Parameters

eExpression

Specifies the index key for which SEEK searches. eExpression can be null.

ORDER 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. See SET ORDER Command for more information about index numbering.

ORDER IDXIndexFileName

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

ORDER [TAG] TagName [OF CDXFileName]

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.

If identical tag names exist in open independent .cdx files, use OF CDXFileName to specify the .cdx file containing the tag.

NoteNote

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

ASCENDING

Specifies that the table is searched in ascending order.

DESCENDING

Specifies that the table is searched in descending order.

IN nWorkArea

Specifies the work area number of the table that is searched.

IN cTableAlias

Specifies the alias of the table that is searched.

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

Expand imageRemarks

Expand imageExample

Expand imageSee Also