testinheritedexpr.obs

来自「格式化源码的最新板」· OBS 代码 · 共 10 行

OBS
10
字号
unit testinheritedexpr;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 function tcitycounter.countcheaptaxis:integer
;begin result:=-1;end;function tcitycounter.countrats(const pscity:string):integer
;begin result:=1000;end;procedure tcitycounter.foo;begin end;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 + =
减小字号Ctrl + -
显示快捷键?