B
Bkhswrp
Unregistered / Unconfirmed
GUEST, unregistred user!
具体代码是这样的:
type
tt=array of real;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure haha(var a:tt);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.haha(var a:tt);
begin
SetLength(a,10);
a[0]:=100;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
wang:tt;
pei:real;
begin
haha(wang);
wang[0]:=pei;
Pei:=1
//不执行
pei:=wang[0];//也不执行
showmessage(inttostr(high(wang)));//显示为9
end;
end.
type
tt=array of real;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure haha(var a:tt);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.haha(var a:tt);
begin
SetLength(a,10);
a[0]:=100;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
wang:tt;
pei:real;
begin
haha(wang);
wang[0]:=pei;
Pei:=1
//不执行
pei:=wang[0];//也不执行
showmessage(inttostr(high(wang)));//显示为9
end;
end.