79073775

Date: 2024-10-10 09:53:52
Score: 0.5
Natty:
Report link

This is an old question but lkessler was right.

Sort function works "bad".

If you test this simple code:

procedure TForm1.List_Text();
var
     list: TStringList;

begin
     list:=TStringList.Create();

     list.Add('.');
     list.Add('-');
     list.Add('.1');
     list.Add('-1');

     list.Sort();

     Memo1.Text:=list.Text;

     list.Free();
end;

The result is:

-
.
.1
-1

This is not correct. If "-" < "." for the two firsts elements the same should happen for the third and fourth.

the correct order should be:

.
.1
-
-1

or

-
-1
.
.1
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: JMCP