Recent

Author Topic: tTimer is not running [SOLVED]  (Read 2283 times)

CM630

  • Hero Member
  • *****
  • Posts: 1091
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
tTimer is not running [SOLVED]
« on: August 31, 2015, 09:47:35 am »
Here is the source:
Code: [Select]
procedure TfrmMain.FormCreate(Sender: TObject);
begin
   Timer1.Enabled:=True;
   timer1.Interval:=5000;
end;

procedure TfrmMain.Timer1Timer(Sender: TObject);
begin
  msgbox ('time is time')
end;     
I expect that I should get a messgaebox each five secons. Actually no messgabox is shown! Never!
My timer is statically created:     Timer1: TTimer;

I've used timers many times before, I just cannot get what is could be doing wrong now?
Win7, Lazarus 1,4,0; FPC 2,6,4; SVN48774

Edit: I have startyed a brand new project. Timers are working in it?!?

Edit: I did cleanup and build. Not it works.
« Last Edit: August 31, 2015, 09:55:59 am by CM630 »
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

derek.john.evans

  • Guest
Re: tTimer is not running [SOLVED]
« Reply #1 on: August 31, 2015, 10:22:23 am »
Verify that OnTimer is setup correctly using something like:
Code: [Select]
Assert(Timer1.OnTimer = @Timer1Timer);

If that's ok, try placing something else in Timer1Timer. I normally just use Beep;


CM630

  • Hero Member
  • *****
  • Posts: 1091
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: tTimer is not running [SOLVED]
« Reply #2 on: August 31, 2015, 09:16:46 pm »
It occurred that for some reason Lazarus launches the app without recompiling. So I have added a timer, but an older build use to run.
AFAIR, there was an option in the settings, forcing it to recompile before each run. I will have to enable it.
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

 

TinyPortal © 2005-2018