Thema: Delphi Listbox sortieren

Einzelnen Beitrag anzeigen

Illuminator-23-5
(Gast)

n/a Beiträge
 
#4

Re: Listbox sortieren

  Alt 21. Aug 2003, 15:09
hier im fall ein beispiel(bubblesort):
Delphi-Quellcode:
procedure Sort;
var
  i, j: integer;
  h: string;
begin
  with ListBox1 do begin
    for i := 1 to ListBox1.Items.Count - 1 do
     for j := i to ListBox1.Items.Count - 1 do begin
        if StrToDate(Items[j] > StrToDate(Items[j-1] then begin
          h := Items[j];
          Items[j] := Items[j-1];
          Items[j+-1] := h;
        end;
    end;
end;
müsste theoretisch funzen!
  Mit Zitat antworten Zitat