<< Click to Display Table of Contents >>

Navigation:  Server Classes > BtServer Class >




Previous pageReturn to chapter overviewNext page





Find a record using its key value







METHOD Seek ( uKey, lSoftSeek )  CLASS BtServer







<uKey>                One key value or an optional array of key values to seek for. The

                 type of the values must match the (VO equivalent of) the btrieve

                 types that the index consists of

<lSoftSeek>                Do we seek for an exact match ?








LOGIC                Was the seek succesfull.







Sends a NotifyIntentToMove message before the operation.

BtServer:Seek() moves to the first logical record whose key value is equal to <uKey>. If such a record is found, it becomes the current record and DBServer:Seek() returns TRUE. Otherwise, BtServer:Seek() returns FALSE and the positioning of the data server is as follows: for a normal (not soft) seek, the data server is positioned to at EOF and DBServer:EOF returns TRUE; for a soft seek, the data server is positioned to the first record whose key value is greater than the specified key value.  If no such record exists, the data server is positioned to DBServer:LastRec + 1 and DBServer:EOF returns TRUE.


When seeking multi-segmented indexes, you should pass all segments if you want to do an exact seek. When you want to seek on not all of the segments, you should set the lSoftSeek to TRUE


IF there is a scope on the active index, BtTable:Seek() will check the scope and return FALSE and set the server to EOF when the record that is found falls out of the scope.




See Also



BtServer, BtTable:Seek(), BtServer:SeekEQ(), BtServer:SeekGT(), BtServer:SeekGE(), BtServer:SeekLE(), BtServer:SeekLT(), BtServer:Found