徐
徐凤华
Unregistered / Unconfirmed
GUEST, unregistred user!
我在程序中需要将数据存放在动态数组中进行传递,但是,使用以下过程,编译器提示:
Incompatible types:'array' and 'dynamic array'.请问如何解决?
程序如下:
procedure Test(var AParam: array of String);
var
S: array of String;
begin
SetLength(S, 2);
S[0] := '0';
S[1] := '1';
AParam := Copy(S);//出错:Incompatible types:'array' and 'dynamic array'
end;
procedure RunTest;
var
Param: array of String;
begin
Test(Param);
end;
将程序重新修改如下:
procedure Test(var AParam: array of String);
begin
SetLength(AParam, 2)
//出错:Incompatible types
......
end;
procedure RunTest;
var
Param: array of String;
begin
Test(Param);
end;
请问各位高手,此问题如何解决?
Incompatible types:'array' and 'dynamic array'.请问如何解决?
程序如下:
procedure Test(var AParam: array of String);
var
S: array of String;
begin
SetLength(S, 2);
S[0] := '0';
S[1] := '1';
AParam := Copy(S);//出错:Incompatible types:'array' and 'dynamic array'
end;
procedure RunTest;
var
Param: array of String;
begin
Test(Param);
end;
将程序重新修改如下:
procedure Test(var AParam: array of String);
begin
SetLength(AParam, 2)
//出错:Incompatible types
......
end;
procedure RunTest;
var
Param: array of String;
begin
Test(Param);
end;
请问各位高手,此问题如何解决?