testinitfinal.out

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

OUT
49
字号
unit TestInitFinal;

{ AFS 1 March 2K
 This unit compiles but is not semantically meaningfull
 it is test cases for the code formatting utility

 This unit tests layout of the code in the init and final section
}

interface

var
  SomeGlobalSeed: integer;
  Fred: TObject;

implementation

uses Classes, SysUtils;

function RandomInt: integer;
begin
  Result := Random(1000);
end;

initialization
  SomeGlobalSeed := RandomInt;

  if SomeGlobalSeed > 20 then
  begin
    while SomeGlobalSeed > 20 do
    begin
      SomeGlobalSeed := SomeGlobalSeed - RandomInt div 100;
    end;
  end;


  fred := TList.Create;


finalization

  while RandomInt < 20000 do
  begin
    FreeAndNil(Fred);
    SomeGlobalSeed := 0;
  end;

end.

⌨️ 快捷键说明

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