Einzelnen Beitrag anzeigen

Benmik

Registriert seit: 11. Apr 2009
542 Beiträge
 
Delphi 11 Alexandria
 
#7

AW: Sortierte TObjectList - Einträge richtig einfügen

  Alt 17. Jul 2015, 14:31
Auf der anderen Seite liefert BinarySearch so ziemlich genau das, was ich will:
Zitat:
The method returns true if it finds the element and false otherwise. If found, Index contains the zero-based index of Item. If not found, Index contains the index of the first entry larger than Item.
Perfekt wär's, wenn das auch noch wär (was es aber nicht ist):
Zitat:
If there is more than one element in the list equal to Item, the index of the first match is returned in Index. This is the index of any of the matching items, not necessarily the first.
Aber sonst ziemlich genau das, was ich nachgebaut habe. Muss doch wohl meine erste generische Liste in Angriff nehmen.

Vielleicht noch eine Idee zu den anderen Fragen?
  Mit Zitat antworten Zitat