ふにゃるんv2

もとは、http://d.hatena.ne.jp/Wacky/

デバッグ用のコード断片

printデバッグ用のコードを書いたのでメモ。
意外と、この手のコードって検索が面倒なので。まぁ。

type
  ...
  procedure DBG(const fmt: string; const args: array of const); overload;
  procedure DBG(const fmt: string); overload;

implementation

{$R *.dfm}

procedure DBG(const fmt: string; const args: array of const);
var
	s: string;
begin
	s := Format(fmt, args);
	OutputDebugString(PChar(s));
end;

procedure DBG(const fmt: string);
begin
	OutputDebugString(PChar(fmt));
end;

DBG関数を二重定義しているのは、パラメータの列挙を省略したかったから。はふぅ。