Timer problem

No errors at all, and it counts down only one time.(1:1:5) C++ builder 6

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
26
27
28
  //---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
int s=3666;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{

     s--;
     int godzin, minut, sekund;
     AnsiString godz, min, sek;
     godzin = s/3600;
     godz = IntToStr(godzin);
     minut = (s - godzin *3600)/60;
     min = IntToStr(minut);
     sekund = s - godzin*3600 - minut*60;
     sek= IntToStr(sekund);
     Label1->Caption = godz+":"+min+":"+sek;

}
Why don't you use the TTimer class ?

http://www.functionx.com/bcb/controls/timer.htm
Topic archived. No new replies allowed.