DBF SEEK()

From Recital Documentation Wiki
Jump to: navigation, search

PURPOSE

Seek a key


SYNONYM

api_dbf_seek()


SYNOPSIS

#include "dbapi.h"
 
int	DBF_SEEK(key, readlock)
 
<input parameters>
char	*key;			/* Index key to seek		*/
int	readlock;			/* Specify a read lock		*/
 
<output parameters>
none


DESCRIPTION

The DBF_SEEK() function will seek the specified key in the master index on the current database. The maximum length of any index key is 200 bytes.

If the value of readlock is specified as 1, then the current record is unlocked and the 'seeked' record is locked. If the value is 0, then the 'seeked' record is read without locking but the record buffer is purged if the database is shareable.

A value of 1 is returned if the key is found in the index, 0 if it is not.


EXAMPLE

The following example seeks the key specified in the first parameter passed and does not perform a readlock.

#include "dbapi.h"
 
dbapi_dbf_seek()
{
    int	rc;
 
    if (_parinfo(1) == API_CTYPE) {
       rc = DBF_SEEK(_parc(1), 0);
    } else {
       rc = -1
    }
 
    _retni( rc );
}


SEE ALSO

DBF_DELETE(), DBF_DELETED(), DBF_FETCH(), DBF_FILTER(), DBF_GOTO(), DBF_ISBOF(), DBF_ISEOF(), DBF_LOCKR(), DBF_RECALL(), DBF_RECNO(), DBF_SKIP(), DBF_UNLOCKR()