Function DbRLockList() Foundation

Determines which records are locked in a work area.

DbRLockList() --> aLockedRecords

The return value of DbRLockList() is a one dimensional array containing the record IDs of all records in the work area which are locked for SHARED write access. When no record locks are in place, an empty array is returned.


The database function DbRLockList() determines which records are locked in a work area. When the function is used without the alias operator, it returns an array containing record IDs of all records locked in the current work area. The record ID is a value clearly identifying the record. It is predetermined by the file format of the data file. For DBF files, the record ID is a numeric value designating the record number (RecNo()) of the record.


// The example shows a function which processes an array 
// containing record IDs. An attempt is made to lock all 
// records listed in the array. The return value is 
// the return value of DbRLockList(), which is an array 
// containing the record numbers for all records that 
// could be locked. 

FUNCTION LockRecords( aRecordID ) 
   LOCAL n, nMax 

   nMax  := Len( aRecordID ) 
   FOR n := 1 TO nMax             // attempt to lock all 
      DbRLock( aRecordID[ n ] )   // specified records 

RETURN DbRLockList()              // return currently 
                                  // locked records 

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.