Searches for the first record in an indexed table whose key matches the specified expression.

Syntax

SEEK(<exp> [,<alias>])

<exp>

The key value to search for.

<alias>

The work area you want to search

Description

SEEK(†) evaluates the expression <exp> and attempts to find its value in the master index of the table opened in the current or specified work area. SEEK(†) returns true if it finds a match of the key expression in the master index, and false if no match is found.

The SEEK(†) function combines the SEEK command and the FOUND(†) function, adding the ability to search in any work area. However, SEEK(†) does not support composite key indexes based on multiple fields used by non-DBF tables.

Because an index search is almost always followed by a test to see if the search was successful, when searching DBF tables, use SEEK(†) instead of SEEK and FOUND(†). FOUND(†) will return the result of the last SEEK(†) as well.

SET NEAR and SET EXACT affect SEEK(†) the same way they affect SEEK. See SEEK for more details.

OODML

Use the Rowset objectís findKey(†) or findKeyNearest(†) methods.