svs123456789
Я делаю так:
Код:
function GetFocusedRecKey: Variant;
var
L: TStringList;
I: Integer;
begin
Result := null;
if qryData.Active then
if Pos(';', View.DataController.KeyFieldNames) = 0 then begin
S := View.DataController.KeyFieldNames;
Result := qryData.FieldByName(S).Value;
end else begin
L := TStringList.Create;
try
L.StrictDelimiter := True;
L.Delimiter := ';';
L.DelimitedText := View.DataController.KeyFieldNames;
Result := VarArrayCreate([0, Pred(L.Count)], varVariant);
for I := 0 to Pred(L.Count) do begin
Result[I] := qryData.FieldByName(L[I]).Value;
end;
finally
L.Free;
end;
end;
end;
Я делаю так:
Код:
function GetFocusedRecKey: Variant;
var
L: TStringList;
I: Integer;
begin
Result := null;
if qryData.Active then
if Pos(';', View.DataController.KeyFieldNames) = 0 then begin
S := View.DataController.KeyFieldNames;
Result := qryData.FieldByName(S).Value;
end else begin
L := TStringList.Create;
try
L.StrictDelimiter := True;
L.Delimiter := ';';
L.DelimitedText := View.DataController.KeyFieldNames;
Result := VarArrayCreate([0, Pred(L.Count)], varVariant);
for I := 0 to Pred(L.Count) do begin
Result[I] := qryData.FieldByName(L[I]).Value;
end;
finally
L.Free;
end;
end;
end;