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

📄 testdefaultparams.out

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

interface

function def1(const pival: integer = 42): boolean;
function def2(bv: boolean = False; const pival: integer = 42): boolean;
function def3(bv: boolean = False; const piaverrylongvalval: integer = 42;
  const short: integer = 42): boolean;

type
  thasdefs = class(TObject)
  public
    procedure fred(const pi: integer = 3; px: double = 34.4); virtual;
    procedure jim(const pi: integer = 3; px: double = 34.4); overload;
    procedure jim(pb: boolean = False); overload;
    procedure bob(const pi: integer = 3; px: double = 34.4); overload;
    procedure bob(const pblongvariablename: pointer = nil;
      const pi: integer = 3; px: double = 34.4); overload;
  end;

implementation

procedure thasdefs.bob(const pi: integer; px: double);
begin
  if pi > 3 then
  begin
    px := pi;
  end;
end;

procedure thasdefs.bob(const pblongvariablename: pointer; const pi: integer; px: double);
begin
end;

procedure thasdefs.fred(const pi: integer = 3; px: double = 34.4);
begin
  if pi > 3 then
  begin
    px := pi;
  end;
end;

function def1(const pival: integer = 42): boolean;
begin
  Result := (pival = 42);
end;

function def2(bv: boolean = False; const pival: integer = 42): boolean;
begin
  if bv then
    Result := def1(pival)
  else
  begin
    Result := def1;
  end;
end;

function def3(bv: boolean = False; const piaverrylongvalval: integer = 42; const short: integer = 42): boolean;
begin
  def2(bv);
end;

procedure thasdefs.jim(const pi: integer; px: double);
begin
  if pi > 3 then
  begin
    px := pi;
  end;
end;

procedure thasdefs.jim(pb: boolean);
begin
  if pb then
    jim(pb);
end;

end.
 

⌨️ 快捷键说明

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