⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testinheritedexpr.out

📁 格式化源码的最新板
💻 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 + -