Ist doch genau dasselbe.
Code: Alles auswählen
procedure Ausgabe1(sa: array of string);
var
i: integer;
begin
for i := 0 to Length(sa) - 1 do begin
WriteLn(sa[i]);
end;
end;
type
Tsa = array of string;
procedure Ausgabe2(sa: Tsa);
var
i: integer;
begin
for i := 0 to Length(sa) - 1 do begin
WriteLn(sa[i]);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Ausgabe1([s1, s2]);
Ausgabe2([s1, s2]); // Error: Incompatible type for arg no. 1: Got "Array Of Const/Constant Open Array of Constant String", expected "Tsa"
end;