littletest19.out

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

OUT
42
字号
unit LittleTest19;

{ This unit compiles but is not semantically meaningfull
 it is test cases for the code formatting utility
 to test properties }

interface

type
  TSoy = class
  protected
    function GetKlingon: integer;
    procedure SetKlingon(const Value: integer);

    // so much for the Lt-Whorf hypothesis
    property Klingon: integer Read GetKlingon Write SetKlingon;
  end;

  TEnterprise = class(TSoy)
  published
    // property is redclared without type but with accessors. This is the key line
    property Klingon Read GetKlingon Write SetKlingon;
  end;

implementation


{ TSoy }

function TSoy.GetKlingon: integer;
begin
  // there's klingons on the starboard bow
  Result := 42;
end;

procedure TSoy.SetKlingon(const Value: integer);
begin
  // well, scrape 'em off
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?