Code: Alles auswählen
function CustomSortFunction(List: TStringList; Index1: Integer; Index2: Integer):Integer;
var s1, s2: String;
i1, i2: Integer;
begin
s1 := Trim(List[Index1]);
s2 := Trim(List[Index2]);
i1:=0;
while s1[i1+1] in ['0'..'9'] do inc(i1);
i2:=0;
while s2[i2+1] in ['0'..'9'] do inc(i2);
if (i1 > 0) and (i2 > 0) then
Result := StrToInt(Copy(s1, 1, i1)) - StrToInt(Copy(s2, 1, i2))
else
Result := AnsiCompareStr(s1, s2);
end;