Delphi-PRAXiS
Seite 3 von 3     123   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi schnellere Alternative zu StringListe.IndexOf() gesucht (https://www.delphipraxis.net/151623-schnellere-alternative-zu-stringliste-indexof-gesucht.html)

himitsu 26. Mai 2010 18:49

Re: schnellere Alternative zu StringListe.IndexOf() gesucht
 
CompareStrings ist eine interne Funktion, welche die Stringliste für die Vergleiche verwendet.

Delphi-Quellcode:
type
  TNaturalStringList = class(TStringList)
  protected
    function CompareStrings(const S1, S2: string): Integer; override;
  public
    constructor Create;
  end;

function TNaturalStringList.CompareStrings(const S1, S2: string): Integer;
begin
  Result := StrNatCompare(S1, S2);
end;

constructor TNaturalStringList.Create;
begin
  Sorted := True;
  Duplicates := dupIgnore;
end;

Helmi 26. Mai 2010 19:50

Re: schnellere Alternative zu StringListe.IndexOf() gesucht
 
Danke fürs Erklären!
Hat funktioniert!


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:33 Uhr.
Seite 3 von 3     123   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz