You've already forked lazarus-ccr
RxFPC:fix TRxMemoryData.Lookup
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8348 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -162,6 +162,7 @@ type
|
|||||||
function IsSequenced: Boolean; override;
|
function IsSequenced: Boolean; override;
|
||||||
function Locate(const KeyFields: string; const KeyValues: Variant;
|
function Locate(const KeyFields: string; const KeyValues: Variant;
|
||||||
Options: TLocateOptions): Boolean; override;
|
Options: TLocateOptions): Boolean; override;
|
||||||
|
function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant; override;
|
||||||
procedure SortOnFields(const FieldNames: string;
|
procedure SortOnFields(const FieldNames: string;
|
||||||
CaseInsensitive: Boolean = True; Descending: Boolean = False);
|
CaseInsensitive: Boolean = True; Descending: Boolean = False);
|
||||||
procedure SortOnFieldsEx(const FieldNames: string;
|
procedure SortOnFieldsEx(const FieldNames: string;
|
||||||
@@ -1525,6 +1526,27 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TRxMemoryData.Lookup(const KeyFields: string;
|
||||||
|
const KeyValues: Variant; const ResultFields: string): Variant;
|
||||||
|
var
|
||||||
|
SaveState: TDataSetState;
|
||||||
|
begin
|
||||||
|
if DataSetLocateThrough(Self, KeyFields, KeyValues, []{, ARecNo}) then
|
||||||
|
begin
|
||||||
|
{ SaveState := SetTempState(dsCalcFields);
|
||||||
|
try
|
||||||
|
// FFilterBuffer contains found record
|
||||||
|
CalculateFields(FFilterBuffer); // CalcBuffer is set to FFilterBuffer
|
||||||
|
Result:=FieldValues[ResultFields];
|
||||||
|
finally
|
||||||
|
RestoreState(SaveState);
|
||||||
|
end;}
|
||||||
|
Result:=FieldByName(ResultFields).Value;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
Result:=Null;
|
||||||
|
end;
|
||||||
|
|
||||||
{ Table Manipulation }
|
{ Table Manipulation }
|
||||||
|
|
||||||
procedure TRxMemoryData.EmptyTable;
|
procedure TRxMemoryData.EmptyTable;
|
||||||
|
Reference in New Issue
Block a user