![]() |
Re: Zahlen ohne Array sortieren?
also ich würde die eingaben in ner TStringList "puffern" und dann nur
zum anzeigen dann an ne listbox oder n memo binden.
Delphi-Quellcode:
var
List: TStringList; implementation function SortFunc(List: TStringList; Index1, Index2: Integer): Integer; var a, b: integer; begin a := StrToInt(List[Index1]); b := StrToInt(List[Index2]); result := a - b; end; procedure TForm1.ButtonAddClick(Sender: TObject); begin List.Add(Edit1.Text); List.CustomSort(SortFunc); Memo1.Lines := List; end; initialization List := TStringList.Create; finalization List.free; end. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:43 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-2025 by Thomas Breitkreuz