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

📄 testdeclarations.out

📁 格式化源码的最新板
💻 OUT
字号:
unit testdeclarations;

interface

const
  fred_const_1 = 34;
  fred_const_two = 'Fred';
  gimp      = 'Glump';
  mo_money  = 123.45;
  pigs_can_fly = False;
  fred_name: string = 'Fred!';
  fred_count: integer = 2;
  fred_money: currency = 234.4;
  maxamount1 = 9.9E+10;
  maxamount2 = +9.9E+10;
  minamount = -9.9E+10;
  tinyamount1 = 9.9E-10;
  tinyamount2 = +9.9E-10;
  tinyamount = -9.9E-10;

resourcestring
  createerror = 'Cannot create fred %s';
  openerror   = 'Cannot open fool %s';
  linetoolong = 'Line too silly';
  productname = 'CodeFormat\000\000';
  someresourcestring = gimp;

type
  t1 = integer;

type
  t2 = type integer;

type
  tintsubrange = -12..23;

const
  bit_twiddled: integer = $F00F;
  hex_value: integer    = $0BADBEEF;
  my_favorite_letter: char = #96;

type
  tstuff      = (ethis, ethat, etheother, esomethingelse, fish, wibble, spon);
  tstuffset   = set of tstuff;
  tsillystuff = fish..spon;

const
  mystuff    = [ethis, etheother];
  otherstuff = [ethat, esomethingelse];

var
  fred1:   integer;
  fredtwo: string;
  f3:      boolean;
  myfile:  file;
  myintfile: file of integer;

type
  tfredproc     = procedure(var psfred: integer) of object;
  tfredfunction = function(const psfred: string): string;
  tmultiparamfn = function(a: integer; b: string; c: currency): TObject;
  tbadlyspacedfn = function(a: integer; b: string; c: currency; d: string): TObject;
  tmultilinefn = function(a: integer; b: string; c: currency; d: string): TObject of object;
  tmultilinefn2 = function(a: integer; const b: string;
    var c: currency; d: string): TObject of object;
  tfluggle = array[1..10] of
    boolean;
  tflig    = array[1..12] of integer;

var
  fred3:     integer = 42;
  myfluggle: tfluggle = (True, False, True, True, False, True, False, True, True, False);
  myflig:    tflig = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);

function fnfred(var pifred: integer): integer;
function fnfredconst(const psfred: string): string;

implementation

function fnfred(var pifred: integer): integer;
var
  lifr:     integer;
  lglimmer: array[4..12] of double;
begin
  lifr   := pifred;
  Result := 3 + lifr;
  if lifr > 12 then
  begin
    Result := Result * 2;
  end;
  myfluggle[Result] := myflig[pifred + 1] + myflig[myflig[pifred + 1]] > 10;
end;

function beeg: double;
begin
  Result := 1;
  Result := Result + 9.9E+10;
end;

function fnfredconst(const psfred: string): string;
const
  fred_prefix = 'Fred ';
resourcestring
  foo = 'Foooo';
var
  lsfredone: string;
begin
  lsfredone := psfred;
  Result    := fred_prefix + lsfredone;
end;

end.
 

⌨️ 快捷键说明

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