irgendwie dreh ich mich im Kreis
probiers mal so:
Delphi-Quellcode:
var
changed: boolean;
nav, help, helpA, helpB, helpC: tListenElement;
begin
repeat
changed := False; //<<<
nav := root;
while Assigned(nav) and Assigned(nav^.next) do
begin
if nav^.name > nav^.next^.name then
begin
helpA := nav;
helpB := nav^.next;
helpC := nav^.next^.next;
help := helpA;
helpA := helpB;
helpB := helpC;
helpC := help;
nav := helpA;
nav^.next := helpB;
nav^.next^.next := helpC;
changed := True;
if help = root then
root := nav;
end;
nav := nav^.next;
end;
until not changed;
end;
wenn's nicht funktioniert häng mal dein Project an, dann probier ich selber mal ein bischen dran rum