RDD

DbRLock()

Lock a record

Syntax

Signature
DbRLock( [xIdentity] ) --> lSuccess

Arguments

xIdentity

Optional record identity. Without it, the current record is locked.

Return value

.T. when the record is locked; otherwise .F..

Description

DbRLock() resolves the current record or xIdentity, asks the active RDD for a record lock, and returns whether it succeeded. The record pointer does not move. A successful lock is added to the current area's lock list and remains until DbRUnlock(), DbUnlock() or area close releases it.

Notes

The area must be open in a compatible sharing mode. Invalid identities, read-only state, sharing conflicts or I/O failures can raise an error or return .F. according to the RDD. DbRLock() keeps other locks; RLock() explicitly releases the area's other record locks first.

Example

DbRlock.prg
PROCEDURE Main()

   QOut( "Record locked: " + IIF( DbRLock(), "YES", "NO" ) )

   RETURN

Output

See also