📄 testinheritedexpr.out
字号:
unit TestInheritedExpr;
{ AFS 28 March 2000
This unit compiles but is not semantically meaningfull
it is test cases for the code formatting utility
test call to inherited method
}
interface
type
TCityCounter = class(TObject)
public
function CountRats(const psCity: string): integer; virtual;
function CountCheapTaxis: integer; virtual;
procedure Foo; virtual;
end;
TLondonCounter = class(TCityCounter)
public
function CountRats(const psCity: string): integer; override;
function CountCheapTaxis: integer; override;
procedure Foo; override;
end;
implementation
{ TRatCounter }
function TCityCounter.CountCheapTaxis: integer;
begin
Result := -1;
end;
function TCityCounter.CountRats(const psCity: string): integer;
begin
Result := 1000;
end;
procedure TCityCounter.Foo;
begin
end;
{ TLondonCounter }
function TLondonCounter.CountCheapTaxis: integer;
begin
Result := inherited CountCheapTaxis;
end;
function TLondonCounter.CountRats(const psCity: string): integer;
begin
Result := inherited CountRats('London') * 42;
end;
procedure TLondonCounter.Foo;
begin
inherited;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -