S
sanrex
Unregistered / Unconfirmed
GUEST, unregistred user!
这个程序没有问题
-------------
type
tt = array of char
implementation
{$R *.DFM}
procedure t(a : tt);
begin
end;
procedure TForm1.Button1Click(Sender: TObject);
var
f : tt;
begin
setlength(f,2);
f[0]:='1'
f[1]:='1'
t(f);
end;
---------
但是
type
tt = array of char
implementation
{$R *.DFM}
procedure t(a : array of char );
begin
end;
procedure TForm1.Button1Click(Sender: TObject);
var
f : array of char
begin
setlength(f,2);
f[0]:='1'
f[1]:='1'
t(f);
end;
就会报错:
[Error] Unit1.pas(36): Incompatible types: 'Array' and 'dynamic array'
-------------
type
tt = array of char
implementation
{$R *.DFM}
procedure t(a : tt);
begin
end;
procedure TForm1.Button1Click(Sender: TObject);
var
f : tt;
begin
setlength(f,2);
f[0]:='1'
f[1]:='1'
t(f);
end;
---------
但是
type
tt = array of char
implementation
{$R *.DFM}
procedure t(a : array of char );
begin
end;
procedure TForm1.Button1Click(Sender: TObject);
var
f : array of char
begin
setlength(f,2);
f[0]:='1'
f[1]:='1'
t(f);
end;
就会报错:
[Error] Unit1.pas(36): Incompatible types: 'Array' and 'dynamic array'