Command SEEK Foundation
Positions the record pointer based on the value of an index expression.
SEEK [LAST] <Expression> ;
ORDER [TAG] <cTagName>|<nIndex> ;
[IN <nWorkArea> | <cAlias> ] ;
[SOFTSEEK]
If <Expression> is a character string, the first entry beginning with this string is searched in the index file. The expression SEEK "An", for example, positions the record pointer on the first record whose index key starts with the letters "An".
When the value of <Expression> is not found in the index file, the position of the record pointer depends on the setting of SET SOFTSEEK. Normally SET SOFTSEEK is set to OFF, causing the record pointer to be positioned on the "Phantom" record when <Expression> is not found in the index file (with DBF files, this corresponds to the position LastRec()+1). The function Found() then returns the value .F. and the function Eof() returns the value .T.. If SET SOFTSEEK is set to ON, an "inexact" search is performed and the data record pointer is positioned on the first record whose value is greater than the value of <Expression>. When such a record exists, the function Found() as well as Eof() return the value .F. (false).
SEEK searches for a value in an index file. If no index file is open in the current work area, no search occurs and the record pointer remains unchanged.
The function DbSeek() is the functional equivalent of the command SEEK.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.