<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi,<br><br>I'm a pascal newbie, after spending some time getting a daemon to work, I now have trouble getting a timer to work. I was recommended to use TFPTimer from the fpTimer unit - http://mantis.freepascal.org/view.php?id=14118&nbn=5<br><br>I tried the following code but the OnTimer doesn't trigger. There are no errors either. Grateful for any pointers. :)<br><br><pre style="margin-top: 0pt; display: inline;">uses<br>fpTimer;<br>...<br> TDaemon1 = class(TDaemon)<br>....<br>private<br>.....<br>public<br> procedure FTimerTimer( Sender : TObject ); <br>.....<br>var<br> Daemon1: TDaemon1;<br> FTimer : TFPTimer;<br>.....<br>procedure TDaemon1.FTimerTimer( Sender : TObject );<br>var<br>...<br> BEGIN<br>....<br>END; <br><br>procedure TDaemon1.DataModuleStart(Sender: TCustomDaemon; var OK: boolean);<br>var<br>...<br>begin <br> FTimer := TFPTimer.Create(nil);<br> FTimer.OnTimer := @FTimerTimer;<br> FTimer.Interval := 1000; // in milliseconds<br> FTimer.Enabled := True; <br> FTimer.StartTimer;</pre><br><br><br>Note: I've also posted here - http://lazarus.freepascal.org/index.php/topic,8615.0.html<br><br><br> <br /><hr />Hotmail: Free, trusted and rich email service. <a href='https://signup.live.com/signup.aspx?id=60969' target='_new'>Get it now.</a></body>
</html>