Alles klar! Vielen Dank. das hab ich nun verstanden
Hätte ich mir die Hilfe mal genauer angeschaut, wäre ich auch selber darauf gekommen ich Pupskopf
Aber ich hab da noch eine Frage.
Ich weiß nicht ganz genau was die hierbei machen.
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
| case (Sender as TListView).Columns[ColumnToSort].Tag of 1: Compare := StrToInt(TextToSort1)-StrToInt(TextToSort2); 2: begin Compare := 0; if StrToFloat(TextToSort1) > StrToFloat(TextToSort2) then Compare := Trunc(StrToFloat(TextToSort1)-StrToFloat(TextToSort2))+1; if StrToFloat(TextToSort1) < StrToFloat(TextToSort2) then Compare := Trunc(StrToFloat(TextToSort1)-StrToFloat(TextToSort2))-1; end; 3: begin Compare := 0; if StrToDateTime(TextToSort1) > StrToDateTime(TextToSort2) then Compare := Trunc(StrToDateTime(TextToSort1)-StrToDateTime(TextToSort2))+1; if StrToDateTime(TextToSort1) < StrToDateTime(TextToSort2) then Compare := Trunc(StrToDateTime(TextToSort1)-StrToDateTime(TextToSort2))-1; end; else Compare := CompareText(TextToSort1,TextToSort2); end; end; |
Ich schätz mal, dass er nachschaut, nach welcher spalte sortiert werden soll, und dann danach geht, ob es ein Datumswert, ein Integerwert, ein Realwert oder ein String ist.
Kann das angehen?
Ich hab das Beispiel aus einem Forum "geklaut"

Bin mir gerade nicht mehr sicher ob dieses hier oder Delphi-Praxis
Also könnte ich bi den case dingern selbst angeben, nach welcher Spalte er wie sortieren soll. Stimmts?
Those who understand binary code and those who don't understand.