function addsum(arr:array of integer):integer;
var i:integer;
begin
result:=0;
for i:=0 to high(arr) do
result:=result+arr;
end;
调用:
var xx:array[1..10] of integer;
i:integer;
begin
for i:=1 to 10 do
begin
xx:=i*10;
end;
showmessage(inttostr(addsum(xx)));
end;