Perhaps SCARs, as this works
SCAR Code:
program WTFISWRONGWITHSCAR;
var
foo, bar:array of integer;
foobar : array of integer;
function MergeArrays(First,Second:array of integer):array of integer;
var length1,length2,pArray:integer;
begin
length1:=getarraylength(first);
setarraylength(result,length1);
result:=first;
length2:=getarraylength(second);
setarraylength(result,(length1+length2));
for pArray:=length1 to (length1+length2-1) do
begin
result[parray]:=second[parray-length1];
end;
end;
procedure PutSomethingIntoFooBar;
begin
setarraylength(foo, 3);
foo[0] := 1;
foo[1] := 2;
foo[2] := 3;
setarraylength(bar, 3);
bar[0] := 4;
bar[1] := 5;
bar[2] := 6;
end;
procedure writearray(var arr : array of integer);
var
i : integer;
begin
for i := 0 to getarraylength(arr) - 1 do
Writeln(inttostr(arr[i]));
end;
begin
PutSomethingIntoFooBar;
Foobar := MergeArrays(foo, bar);
WriteArray(foobar);
end.
But this
SCAR Code:
program WTFISWRONGWITHSCAR;
var
foo, bar:array of string;
foobar : array of string;
function MergeArrays(First,Second:array of string):array of string;
var length1,length2,pArray:integer;
begin
length1:=getarraylength(first);
setarraylength(result,length1);
result:=first;
length2:=getarraylength(second);
setarraylength(result,(length1+length2));
for pArray:=length1 to (length1+length2-1) do
begin
result[parray]:=second[parray-length1];
end;
end;
procedure PutSomethingIntoFooBar;
begin
setarraylength(foo, 3);
foo[0] := '1';
foo[1] := '2';
foo[2] := '3';
setarraylength(bar, 3);
bar[0] := '4';
bar[1] := '5';
bar[2] := '6';
end;
procedure writearray(var arr : array of string);
var
i : integer;
begin
for i := 0 to getarraylength(arr) - 1 do
Writeln(arr[i]);
end;
begin
PutSomethingIntoFooBar;
Foobar := MergeArrays(foo, bar);
WriteArray(foobar);
end.
gives
SCAR Code:
RSC font has been loaded
19.01.2007
Believe it or not but there is a new SCAR version almost ready.
More information: [url]http://villu-reborn.com/showthread.php?t=5996[/url]
Successfully compiled
1
2
3
4
5
6
Successfully executed
Successfully compiled
1
2
3
4
5
6
Successfully executed
Successfully compiled
1
2
3
4
5
6
Successfully executed
Successfully compiled
1
4
5
6
Successfully executed
Successfully compiled
1
2
3
4
5
6
Successfully executed
Successfully compiled
1
2
[Runtime Error] : Exception: Access violation at address 00404F04 in module 'scar.exe'. Read of address FFFFFF85 in line 39 in script