Chris
2013-04-08 19:31:18
Running the following code gives the "Something has gone wrong in Simba"-thing.
Though the following does work:
I've tried/tested a lot myself, but it seems like there's a bug with the parameters.. Or am I missing something?
program AddStrArraysTest;
procedure PushStrArr(var StrArr: TStringArray; Value: string);
var
L: Integer;
begin
L := Length(StrArr);
SetLength(StrArr, L + 1);
StrArr[L] := Value;
end;
procedure AddStrArrays(Arr, Arr2: TStringArray; var Store: TStringArray);
var i: Integer;
begin
Store := Arr;
for i := 0 to High(Arr2) do
PushStrArr(Store, Arr2[i]);
end;
var StrArray, Arr2, StoreIn: TStringArray;
begin
StrArray := ['Hello', 'Members'];
Arr2 := ['Of', 'SRL'];
AddStrArrays(StrArray, Arr2, StoreIn);
writeln(StoreIn);
end.Though the following does work:
program new;
var a: TStringArray;
L: Integer;
begin
a := ['Hello', 'SRL'];
L := Length(a);
SetLength(a, L + 1);
a[L] := 'You ROCK';
writeln(a);
end.I've tried/tested a lot myself, but it seems like there's a bug with the parameters.. Or am I missing something?