Autor Beitrag
Xabitire
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 114

Win Xp, Win Vista
D6 PE, D7 PE
BeitragVerfasst: Fr 27.04.07 20:09 
Hi Leute,

wollte mal fragen, ob man folgenden Quelltext optimieren kann:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
for i:= 1 to l do
    begin
    application.ProcessMessages;
    Memo1.Lines.Add(IntToStr(Feld[i])); // Feld: array of integer;
  end;


Und zwar ist es so, dass in "Feld" schon mal so 1000000 Zahlen gespeichert sein können, und es auf diese Art und Weise verdammt lange dauert, bis die alle ins Memo geschrieben sind. Wollt deshalp mal Fragen ob es irgendeine scnnellere Möglichkeit gibt?

Mfg

Blackbird8690
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 27.04.07 21:10 
Hallo,

was willst Du mit 1 Millionen Zahlen in einem Memo :roll: , wer soll die denn lesen.

Abgesehen davon:

- application.ProcessMessages weglassen
- BeginUpdate davor
- EndUpdate dahinter

- nur die aktuell benötigten Daten anzeigen

- andere Komponente verwenden

Wofür brauchst Du denn das?

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Xabitire Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 114

Win Xp, Win Vista
D6 PE, D7 PE
BeitragVerfasst: Fr 27.04.07 21:43 
Das Ganze ist Teil einer Statistik und das Programm ist auch noch nicht fertig!

Und um jetzt halt zu prüfen, ob ich bis jetzt keine Fehler gemacht habe geb ich die Zahlen in einem Memo aus und prüfe Stichprobenweise.

Bin jetzt gerade dabei das Programm zu optimieren und es hat mich halt gewundert, das ich für 5 Rechenschritte mit 1 Mio. Zahlen net mal 1 sec brauch aber um alle Zahlen in einem Memo auszugeben immer ewig lange waten muss.

Deshalb wollt ich mal wissen, ob es eine bessere Methode gibt.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 27.04.07 21:57 
Hallo,

dann greif doch Stichprobenweise direkt auf das Feld zu :wink:

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )