If one is a string and one is an int, the value of the string from val is 0 so it will before.
if (Item1 = nil) or (Item2 = nil) then Exit;
r1 := IsValidNumber(s1, i1);
r2 := IsValidNumber(s2, i2);
if (r1 and r2) then
Result := CompareNumeric(i1, i2)
else
if r1 then
result := -1
else
if r2 then
result := 1
else
begin
Result := Length(s1) - Length(s2);
if Result = 0 then
Result := lstrcmp(PChar(s1), PChar(s2));
end;
end;
I think, no Dephi on the machine to check.