<< Click to Display Table of Contents >> Navigation: Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Properties > LockList |
Declaration
property LockList[Index: Integer]: Integer;
Description
Run-time, Read-Only. Returns the record number of the specified item in the list of locked records (starting with zero). Records are locked using RLock and unlocked using Unlock. The total number of records contained in the lock list can be derived through the LockCount property. Attempting to access an invalid item number results in a zero (0) return value.
Multiple record locking is not available under Delphi 3.x.
Delphi Example
// Locks every other record in a table, and adds the
// locked record numbers to a TMemo
procedure TForm1.Button1Click(Sender: TObject);
var
i, lVal : LongInt;
begin
with ApTbl do
begin
Open;
lVal := RecCount;
for i := 1 to lVal do
begin
// Lock every other record (even ones only)
if (i mod 2) = 0 then
begin
try
RLock( i );
except
ShowMessage( 'Unable to lock record #' + IntToStr( i ));
end;
Form1.Caption := IntToStr( i ) + ': ' +
IntToStr( LockCount ) + ' record(s) locked.';
Application.ProcessMessages;
end;
end;
Memo1.Clear;
for i := 0 to (LockCount-1) do
Memo1.Lines.Add( IntToStr( LockList[i] ));
end;
end;
See Also