Oder sich für alle Arten von Arrays etwas basteln:
Delphi-Quellcode:
procedure FillArray (var aArray : Array of Integer; aValue: Cardinal); overload;
var
ndx : integer;
begin
for ndx := Low(aArray) to High(aArray) do
aArray[ndx] := aValue;
end;
procedure FillArray (var aArray : Array of Char; aValue: Char); overload;
var
ndx : integer;
begin
for ndx := Low(aArray) to High(aArray) do
aArray[ndx] := aValue;
end;
procedure FillArray (var aArray : Array of String; aValue: String); overload;
var
ndx : integer;
begin
for ndx := Low(aArray) to High(aArray) do
aArray[ndx] := aValue;
end;
procedure TForm1.btn_TestClick(Sender: TObject);
var
myStringArray : Array[2..10] of String;
myIntegerArray : Array[2..10] of Integer;
myCharArray : Array[2..10] of Char;
begin
FillArray(mystringArray,'blubb');
FillArray(myIntegerArray,1);
FillArray(myCharArray,' ');
end;
Stephan B.
"Lasst den Gänsen ihre Füßchen"