type
TMyRecord = record
num: Integer;
strArray: array of string;
end;
function GetStrArray(const ANum: Integer; var AStrArray: array of string): TMyRecord;
var
i: Integer;
begin
SetLength(Result.strArray, Length(AStrArray));
for i:=0 to Length(AStrArray)-1 do
begin
with Result do
begin
num := ANum + i;
strArray := AStrArray;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
strArray: array of string;
strRec: TMyRecord;
begin
SetLength(strArray, 3);
strArray[0] := 'a';
strArray[1] := 'b';
strArray[2] := 'c';
strRec := GetStrArray(0, strArray);
if strRec.strArray[0] <> 'b' then
ShowMessage('b');
end;