QMRecordlocked()

Top  Previous  Next

 

The QMRecordlocked function queries the lock on a record. It is analogous to the QMBasic RECORDLOCKED() function.

 

 

Format

 

VBQMRecordlocked(ByVal FileNo as Integer, ByVal Id as String) As Integer

 

Cint QMRecordlocked(int FileNo, char * Id)

 

ObjSession->Recordlocked(FileNo, Id)

 

where

 

FileNois the file number returned by a previous QMOpen() call.

 

Idis the id of the record to be locked.

 

 

The QMRecordlocked() function can be used to query the lock state of a record. The returned value is

 

 

Value

Token

Lock state

-3

LOCK$OTHER.FILELOCK

Another user holds a file lock

-2

LOCK$OTHER.READU

Another user holds an update lock

-1

LOCK$OTHER.READL

Another user holds a read lock

0

LOCK$NO.LOCK

The record is not locked

1

LOCK$MY.READL

This user holds a read lock

2

LOCK$MY.READU

This user holds an update lock

3

LOCK$MY.FILELOCK

This user holds a file lock

 

A record may be multiply locked in which case the QMRecordlocked() function reports only one of the current locks. File locks take precedence over read or update locks. If no file lock is set, read or update locks held by the process in which the QMRecordlocked() function is performed take precedence over locks held by other processes.

 

 

Examples

 

VB

State = QMRecordlocked(fClients, ClientNo)

C

State = QMRecordlocked(fClients, ClientNo);

QMBasic

State = session->Recordlock(fClients, ClientNo)

 

 

See also:

RECORDLOCKED(), QMRecordlock