SRL Archive - OSR Help

TTimer not working


rj

2013-06-10 16:43:40

var
frmMain: TForm;
ThreadOne: TTimer;
Params: TVariantArray;

procedure OnTick(Sender: TObject);
begin
Writeln('progress report');
end;

procedure InitialiseTimer;
begin
ThreadOne := TTimer.Create(frmMain);
end;

procedure InitialiseForm;
begin
frmMain := TForm.Create(nil);
end;

begin
ThreadSafeCall('InitialiseForm', Params);
ThreadSafeCall('InitialiseTimer', Params);
ThreadOne.OnTimer := @OnTick;
ThreadOne.Interval := 900;
ThreadOne.Enabled := True;

repeat
Writeln('Mainloop');
Sleep(500);
Until(IsKeyDown(VK_F3));

ThreadOne.Enabled := False;
ThreadOne.Free;
frmMain.Close;
frmMain.Free;
end.

The TTimer isn't working here, any ideas?

Olly

2013-06-10 16:48:56

If your trying to use a script with it to hack "multithreading" it won't work.

(Im sure ive told you multiple times lol)

rj

2013-06-10 16:57:20

From: Ollybest
If your trying to use a script with it to hack "multithreading" it won't work.

(Im sure ive told you multiple times lol)


No.. uhh… i wanted to test out ttimer and i was wondering why it didn't work

Kevin

2013-06-10 17:03:41

I told you this wasn't working too. You can solve your problem in so many other ways, you don't need a ttimer to do real-time proggies.