![]() |
array mit records sortieren
hallo freunde!
ich habe eine reccord namens mannschaften und nöchti dies nach pkt sortieren
Delphi-Quellcode:
for i := 1 to 7 do
begin if mannschaft[i].pkt > mannschaft[(i+1)].pkt then begin Hilfe := mannschaft[i]; mannschaft[i] := mannschaft[i+1]; mannschaft[(i+1)] := Hilfe; end; so habe ich es probier doch da kam immer eine Zugriffsverletzung kann mier jemand helfen?????????? bitte ich bin am verzweifeln thx morepheus |
Re: array mit records sortieren
für kleine Datenmengen wäre der Bubblesort geeignet:
Delphi-Quellcode:
...:cat:...
for i := Low(mannschaft) to Pred(High(mannschaft)) do
for j := Succ(i) to High(mannschaft) do if mannschaft[i].pkt > mannschaft[j].pkt then begin Hilfe := mannschaft[i]; mannschaft[i] := mannschaft[j]; mannschaft[j] := Hilfe; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:55 Uhr. |
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 by Thomas Breitkreuz