SEEK

From Recital Documentation Wiki
Revision as of 12:58, 26 May 2009 by Yvonnemilne (Talk | contribs)

Jump to: navigation, search

Class

Indexing


Purpose

Search for specified key in the master index and if found, position the record pointer in the table


Syntax

SEEK <key expression>


See Also

DBXDESCEND(), DESCEND(), DESCENDING(), DTOS(), EOF(), FIND, INDEX, FOUND(), LTOS(), SET EXACT, SET TALK, STR()


Description

The SEEK command is identical to the FIND command, except that you can specify any valid expression as the key without the need to use macros. The SEEK command looks up the specified key in the master index file. If the key is found, then the FOUND() function will return .T., and the EOF() function will return .F.. If the key is not found, then the FOUND() function will return .F., and the EOF() function will return .T..

In the Recital/4GL, you can build indexes on any data type or any combination of data types. The conversion functions STR(), DTOS() and LTOS() are used to build indexes on mixed data types. The DESCEND() function can also be used to build indexes in descending key order. If the DESCEND() function is used to create the index key, it must also be used in the search <key expression>. Tag indexes built with the DESCENDING keyword require the use of the DBXDESCEND() function in the <key expression>. The DESCENDING() function can be used to determine whether a particular tag was built with the DESCENDING keyword.

If SET TALK ON is in effect and the specified key is not found, then the system displays a message on the screen. If SET EXACT is OFF, then the Recital/4GL will match partial keys. If SET EXACT is ON, then the Recital/4GL will match only complete keys.


Example

use patrons
index on event to events
seek "BALLET"
 
index on date to dates
seek ctod("01/01/2000")
 
index on dtos(eventdate) + "/" + event to dates
seek "20010101/BALLET"


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer