[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| SEEK |
+---------------------------------+
SEEK <expr>
-----------------------------------
Searches an indexed database.
-----------------------------------
SEEK searches an indexed database for the first occurrence of a record
whose index key expression matches <expr>. SEEK will only work with
indexed databases, and you may only SEEK on the index key expression.
The match must be exact unless SET EXACT is OFF.
If SEEK finds a matching record, RECNO() will return the record number
of the matching record, FOUND() will return true (.T.) and EOF() will
return false (.F.).
If a match is not found, RECNO() will return the number of records in
the database plus one, FOUND() will return false (.F.) and EOF() will
return true (.T.). If SET NEAR is ON, the record pointer is positioned
immediately after the closest matching record. If SET NEAR is OFF, the
record pointer will be positioned at the end of the file. In either
case, RECNO(0) still returns the record number of the closest record.
+---------------------------------+
| Example |
+---------------------------------+
USE customer
INDEX ON UPPER(company) TAG Company
SET EXACT OFF
STORE 'JEANNIE' TO mval
SEEK mval
IF FOUND()
DISPLAY
ENDIF
In this example, CUSTOMER database is opened and is indexed on the field
COMPANY. SEEK is then used to find the index key expression that
matches the memory variable MVAL.
-----------------------------------
See Also: FIND, INDEX, LOCATE, RECNO(), SEEK(), SET NEAR
-----------------------------------
See Also:
FIND
INDEX
LOCATE
RECNO()
SEEK()
SET NEAR
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson