Autor Beitrag
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Fr 28.10.05 12:34 
Heyho,

ich kopiere reichlich viele Daten in eine Table rein und weil das manchmal doch recht lange dauert, würde ich gern ne Progressbar einbauen, damit man sieht, ob sich noch was tut, bzw. ob's noch lange dauert.
Dazu öffne ich meine Datei, zähle durch, wie viele Datensätze drin sind und setzte das Ergebnis ins Max der Progressbar.
Dann starte ich meine Kopier-Schleife und immer am Ende setze ich Progressbar.StepIt . Das Problem ist aber, die Progressbar läuft nicht schön langsam einmal durch bis alle Daten kopiert sind, sondern läuft einmal durch, läuft noch mal durch, und noch mal und nochmal ... sie fängt also immer wieder von vorne an. Aber warum? Bzw. was kann ich dagegen tun???
King555
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 28.10.05 12:41 
Ich nehme ganz stark an, dass du die "Max"-Eigenschaft nicht gesetzt hast (in deinem Fall auf die Anzahl der Datensätze).
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Fr 28.10.05 12:45 
Hast du geprüft, ob die Anzahl der Datensätze, die du ermittelst, auch stimmt?

_________________
Bravery calls my name in the sound of the wind in the night...
Miri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Fr 28.10.05 13:14 
Ich mache folgendes:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
  i := 0;
  while not EOF(f1) do
    begin
      ReadLn(f1, s1);
      i := i + 1;
    end;
  reset(f1);
  ProgressBar1.Min := 0;
  ProgressBar1.Max := i;


Hab mir i auch schon mal ausgeben lassen, das passt. Hängt es eventuell damit zusammen, dass i nen Wert von ungefähr 150000 hat? Wenn ja, was dann??
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 28.10.05 13:21 
Hallo,

hast Du die Eigenschaft Step der Progressbar auch richtig gesetzt?

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

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Fr 28.10.05 13:22 
Auf welchem Wert steht denn die Step-Eigenschaft der PRogressbar?

_________________
Bravery calls my name in the sound of the wind in the night...
Miri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Fr 28.10.05 13:34 
wie müsste die denn stehen, bzw. wie setzte ich die??
King555
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 28.10.05 13:40 
ProgressBar1.Step := 1
Miri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Fr 28.10.05 13:50 
Danke, jetzt gehts :)
Amiga-Fan
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Di 07.03.06 12:44 
bei sowas auch das Fetchall nicht vergessen, zumindest wenn die Quelle eine Datenbank ist. Ansonsten stimmt recordcount nicht.

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen