C
coolzew
Unregistered / Unconfirmed
GUEST, unregistred user!
ta = class
public
function aaa:boolean;virtual;
end;
tb = class(ta)
public
function aaa:Boolean;override;
end;
{ ta }
function ta.aaa: boolean;
begin
Result := True;
end;
{ tb }
function tb.aaa: Boolean;
begin
Result := False;
inherited aaa;
// inherited
//为什么这样写会报错呢???????
end;
测试代码如下:
var b :tb;
begin
b := tb.Create;
if b.aaa then showMessage('');//返回的结果总是False
end;
问题在注释中,请高手解答
public
function aaa:boolean;virtual;
end;
tb = class(ta)
public
function aaa:Boolean;override;
end;
{ ta }
function ta.aaa: boolean;
begin
Result := True;
end;
{ tb }
function tb.aaa: Boolean;
begin
Result := False;
inherited aaa;
// inherited
//为什么这样写会报错呢???????
end;
测试代码如下:
var b :tb;
begin
b := tb.Create;
if b.aaa then showMessage('');//返回的结果总是False
end;
问题在注释中,请高手解答