<< Click to Display Table of Contents >> Navigation: Apollo API Listing > sx_DBRlockList |
Declare Sub sx_DBRlockList Lib "Apollo9.dll"
(vpVar As Any)
VOID FAR PASCAL sx_DBRlockList (LONGP lpRecList);
Retrieve a lock array of record numbers and place it in a pre-dimensioned array of long integers.
vpVar: Pointer to array containing record lock list.
' Test Multiple locking in the current work area
Dim iCount As Integer
Dim iRet As Integer
Dim i As Integer
Dim DynamicArray() As Long
iRet = sx_Rlock(3)
iRet = sx_Rlock(5)
iRet = sx_Rlock(2)
iRet = sx_Rlock(7)
Debug.Print sx_Locked(2)
Debug.Print sx_Locked(3)
Debug.Print sx_Locked(5)
Debug.Print sx_Locked(7)
iCount = sx_LockCount()
ReDim DynamicArray(iCount)
sx_DBRlockList DynamicArray(0)
For i = 1 To iCount
sx_Unlock DynamicArray(i - 1)
Debug.Print sx_Locked(DynamicArray(i - 1))
Next
C Example
void ProcessRecords(void)
{
int iCount;
int i;
long lLocks[10];
// using the current work area, test multi locks
sx_Rlock(3);
sx_Rlock(5);
sx_Rlock(2);
sx_Rlock(7);
iCount = sx_LockCount();
sx_DBRlockList((LONGP)lLocks);
for (i = 1, i <= iCount, i++)
sx_Unlock(lLocks[I]);
return;
}