Autor Beitrag
barty
Hält's aus hier
Beiträge: 10



BeitragVerfasst: Fr 17.03.06 19:57 
hallo

gibt es eine möglichkeit, einen timer der läuft zu unterbrechen und dann wieder fortfahren zu lassen?

sprich der timer hat ein intervall von 5min. nach 2 min hält er an, weil ein button geklickt wird, nach einem weiteren klick soll der timer fortfaren, sprich die letzten 3 min arbeiten und dann seine procedure ausführen.

hoffe ihr hab mich verstanden
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5285
Erhaltene Danke: 29

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Fr 17.03.06 20:19 
mit timer.enabled gehts nicht ?

hm, nimm nen 2. timer mit 1ms und check da wie viel noch nach ist, was anderes (außer das umschreiben von ttimer) fällt mir spontan nicht ein.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 18.03.06 08:44 
ausblenden 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:
var
  Form1: TForm1;
  Zaehler:Integer;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Timer1.Enabled:=not Timer1.Enabled;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Inc(Zaehler);
  Caption:=IntToStr(Zaehler);
  if Zaehler=300 then Timer1.Enabled:=False;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Timer1.Enabled:=False;
  Timer1.Interval:=1000;
end;
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 18.03.06 14:25 
Den Zähler brauchste aber nicht unbedingt.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 18.03.06 14:38 
user profile iconGTA-Place hat folgendes geschrieben:
Den Zähler brauchste aber nicht unbedingt.

Und wann sind dann die Fünf Minuten um.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 18.03.06 14:45 
Stimmt, dass er die letzten 3 Min noch ausführen will, daran hab ich nicht gedacht (würde aber trotzdem ohne Zähler gehen).

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)