2009. június 17., szerda

Determine if a given TTable has a restricted view


Problem/Question/Abstract:

I am trying to write a function to determine if a given TTable has a restricted view. The filtered and master-detail views are easy. Is there a way to determine if SetRange / ApplyRange, etc. have been used for a table? This is for Paradox tables.

Answer:

TMyTable = class(TTable)
public
  function IsRangeActive: Boolean;
end;

function TMyTable.IsRangeActive: Boolean;
begin
  Result := BuffersEqual(GetKeyBuffer(kiRangeStart), GetKeyBuffer(kiCurRangeStart),
    SizeOf(TKeyBuffer) + RecordSize) and BuffersEqual(GetKeyBuffer(kiRangeEnd),
    GetKeyBuffer(kiCurRangeEnd), SizeOf(TKeyBuffer) + RecordSize);
end;

Nincsenek megjegyzések:

Megjegyzés küldése