N
netbug
Unregistered / Unconfirmed
GUEST, unregistred user!
请看例子:
type
Taa=class
x:integer;
y:integer;
constructor create;
end;
constructor Taa.create;
begin
x:=12;
y:=23;
end;
type
Tbb=class
function getaa:Taa;
property aa:Taa read getaa;
end;
function Tbb.getaa:Taa;
begin
result:=Taa.create;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
with aa do
begin
edit1.text:=inttostr(x);
edit2.text:=inttostr;
end;
end;
此例Tbb中的域aa的类型是类Taa,但在编译时同不过,请问错在哪里?如何更改?谢谢。
type
Taa=class
x:integer;
y:integer;
constructor create;
end;
constructor Taa.create;
begin
x:=12;
y:=23;
end;
type
Tbb=class
function getaa:Taa;
property aa:Taa read getaa;
end;
function Tbb.getaa:Taa;
begin
result:=Taa.create;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
with aa do
begin
edit1.text:=inttostr(x);
edit2.text:=inttostr;
end;
end;
此例Tbb中的域aa的类型是类Taa,但在编译时同不过,请问错在哪里?如何更改?谢谢。