Autor Beitrag
Crishnu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31



BeitragVerfasst: Mi 15.06.05 22:45 
Ich habe ein Problem!

Ich will mithilfe der Timer-Komponente,
dass zb alle 10 sec auf eine bestehende Zahl
etwas draufaddiert wird.
Nur bei mir wird bei der Timer Komponente der errechnete
Wert nie übernommen.

Bsp:

Zahl:=Zahl+10;

da müsste erst 10 dann 20,30,40 rauskommen, der bleibt bei mir immer
bei 10 stehen.

Kann mir da jemand helfen?
Pr0g
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220


D7 Pers
BeitragVerfasst: Mi 15.06.05 22:47 
Hast du beim Timer Enabled auf True? Ist der Intervallwert vielleicht zu hoch? Wie überprüfst du den Wert der Variable? Addieren kannst du besser so (sollte aber nichts mit dem Problem zu tun haben):
ausblenden Delphi-Quelltext
1:
Inc(Zahl, 10);					


MfG Pr0g
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 15.06.05 22:55 
Hast du die Variable "Zahl" global deklariert? Wenn Sie in der OnTimer procedur steht dann kann
sie nicht hochgezählt werden! Weil sie undefiniert oder 0 ist beim nächsten proceduraufruf!


Zuletzt bearbeitet von JRegier am Mi 15.06.05 23:05, insgesamt 1-mal bearbeitet
Pr0g
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220


D7 Pers
BeitragVerfasst: Mi 15.06.05 23:02 
@JRegier: Wofür zitierst du meinen ganzen Post :roll:
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 15.06.05 23:05 
user profile iconPr0g hat folgendes geschrieben:
@JRegier: Wofür zitierst du meinen ganzen Post :roll:


Ok Chef ich haben das entfernt! :wink:
Blackheart
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 164

ME
D3Prof.-D6Standard
BeitragVerfasst: Mi 15.06.05 23:07 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Zahl:=Zahl+10;
  Caption:=IntToStr(Zahl);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Zahl:=0;
end;
Pr0g
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220


D7 Pers
BeitragVerfasst: Mi 15.06.05 23:15 
Hast du als Timerintervall 10000? Ist der Timer aktiv? Sonst pack mal ein
ausblenden Delphi-Quelltext
1:
ShowMessage('Test');					

mit in den OnTimer Code um zu prüfen, ob er ausgeführt wird.