Record Helper
Ex :
type
TComboBoxHelper = class helper for TComboBox
public
procedure LoadStrings(const AStrings: TStrings); // 載入資料
function SelectedValue: string; // 取得選取文字
procedure SelectValue(const AValue: string); // 設定選取文字
procedure ClearAndLoad(const AStrings: array of string); // 快速清空並載入
end;
public
procedure LoadStrings(const AStrings: TStrings); // 載入資料
function SelectedValue: string; // 取得選取文字
procedure SelectValue(const AValue: string); // 設定選取文字
procedure ClearAndLoad(const AStrings: array of string); // 快速清空並載入
end;
Ex:
type
TIntegerHelper = record helper for Integer
public
function ToString: string;
end;
function TIntegerHelper.ToString:String;
begin
Result := IntToStr(Self);
end;
procedure TForm1.Button1Click(Sender: TObject);
var a:Integer;
begin
showmessage(a.ToString());
end;
有國外網友將DateTime Class擴充功能,利於方便操作