close

使用TStringList 達成依照數字大小排序

unit XBCurrList;

interface

uses System.Classes, System.Math, System.SysUtils;

type
  TXBCurrList = class(TStringList)
  private
    function CompareStrings(const S1: string; const S2: string): Integer; override;
  end;

implementation

{ TXBCurrList }

function TXBCurrList.CompareStrings(const S1, S2: string): Integer;
begin
  result := CompareValue(StrToCurrDef(S1, 0), StrToCurrDef(S2, 0));
end;

end.

arrow
arrow

    抓狂小白 發表在 痞客邦 留言(0) 人氣()