SEEK Command Example

In the following example, customer is opened and indexed on the company field. SEEK is used to find the index key expression that matches the value contained in the variable gcSeekVal.

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE customer ORDER company  && Opens Customer table

SET EXACT OFF
STORE 'B' TO gcSeekVal
SEEK gcSeekVal

IF FOUND( )
   DISPLAY FIELDS company, contact
ENDIF