<< Click to Display Table of Contents >> Navigation: Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Properties > LockCount |
Declaration
property LockCount: Word;
Description
Run-time, Read-Only. Returns the total number of records currently locked via RLock. The maximum number of concurrent locks is 64k.
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