title: Delphi TStringList CustomSort on Name
body: <p>I try to sort an TStringList on the Name part. For do that, I use the customSort method.</p>
  
  <p>I show you a little example :</p>
  
  <pre><code>    function CompareString(List : TStringList; Index1, Index2 : integer) : integer;
      begin
          result := AnsiCompareText(List.Names[Index1], List.Names[Index2]);
      end;
      procedure TForm1.Button1Click(Sender: TObject);
      begin
          Memo2.Clear;
          Liste.CustomSort(CompareString);     
          Memo2.Lines.Append(Liste.GetText)
      end;
  
      procedure TForm1.FormCreate(Sender: TObject);
      begin
          Liste := TStringList.Create;
          Liste.Append('INFOS_NEGOCE=NUM_CDE');
          Liste.Append('INFOS_NEGOCE=DATE_CDE');
          Liste.Append('INFOS_NEGOCE=NOM_REPERTOIRE_ENT');
          Liste.Append('INFOS_NEGOCE=NOM_CONTACT');     
          Memo1.Lines.Clear;
          Memo1.Lines.Append(Liste.GetText)
      end;
  </code></pre>
  
  <p>The sort give me this result :</p>
  
  <pre><code>INFOS_NEGOCE=NOM_REPERTOIRE_ENT
  
  INFOS_NEGOCE=NOM_CONTACT
  
  INFOS_NEGOCE=NUM_CDE
  
  INFOS_NEGOCE=DATE_CDE
  </code></pre>
  
  <p>I think that the sort DON'T change the order of the line (the name is always INFOF_NEGOCE).</p>