delphi refactor

procedure TCameraComponentForm.btnRefreshConfigClick(Sender: TObject);
var
a:string;
begin
a:=CameraComponent1.CaptureSetting.Width.ToString;

Memo1.Lines.Add( a);
end;

不仅可以重构成 过程

还可以重构函数参数,真强大!

procedure TCameraComponentForm.btnRefreshConfigClick(Sender: TObject);
var
a:string;
begin
a:=CameraComponent1.CaptureSetting.Width.ToString;
  AddLog(a);
end;

procedure TCameraComponentForm.AddLog(a: string);
begin
  Memo1.Lines.Add(a);
end;

 

posted on 2015-07-24 14:33  lypzxy  阅读(412)  评论(0编辑  收藏  举报