When using a dynamic array as procedure parameter I get error 'E2010 Incompatible types: 'arrDouble' and 'procedure, untyped pointer or untyped parameter'. The code I use is this:
arrDouble = array of double;
procedure reduce_array (var src: arrDouble; var dst: arrDouble; dst_len: Int32);
begin ... end;
procedure enlarge_array (var src: arrDouble; var dst: arrDouble; dst_len: Int32);
begin ... end;
procedure procrust_array (var src: arrDouble; var dst: arrDouble; dst_len: Int32);
var
temp: arrDouble;
i: Int32;
n: Int32;
begin
n := Length (src);
if n = dst_len then
begin
SetLength (dst, n);
for i := 0 to n - 1 do dst [i] := src [i];
end else if n > dst_len then
begin
dst := reduce_array (src, dst, dst_len);
end else
begin
temp := enlarge_array (src, temp, dst_len);
dst := reduce_array (temp, dst, dst_len);
end;
end; // procrust_array //
I get this error at the call of enlarge_array and reduce_array. The var
is not strictly necessary, but is one of the tests I tried (it makes no difference using var
or not). I found a report to the same error but I couldn't see how the suggested solutions applied to this problem.