Forum > LCL

Error encountered with fptimer

(1/2) > >>

jl:
Hi, sometime back, I had a problem with getting TTimer to work with a Daemon, and was advised to use fptimer instead as TTimer only works with GUI app - http://mantis.freepascal.org/view.php?id=14118&nbn=5

I've encountered some issues with fptimer, search google for all articles on fptimer, but no clues. :(


--- Code: ---uses
fpTimer;
...
public
    procedure FTimerTimer( Sender : TObject );  
.....

procedure TDaemon1.FTimerTimer( Sender : TObject );
var
...
 BEGIN
....
END;                

procedure TDaemon1.DataModuleStart(Sender: TCustomDaemon; var OK: boolean);
var
...
begin    
 FTimer := TFPTimer.Create(nil);
 FTimer.OnTimer := @FTimerTimer;
 FTimer.Interval := 1000; // in milliseconds
 FTimer.Enabled := True;        
 FTimer.on;    --> this line throws the error: identifier idents no member "on"

--- End code ---

theo:
What is your question?

jl:
 FTimer.on;    --> this line throws a complilation error: identifier idents no member "on"

theo:

--- Quote from: touchring on February 12, 2010, 08:56:57 pm --- FTimer.on;    --> this line throws a complilation error: identifier idents no member "on"

--- End quote ---

It says there is no member "on".  But what is the question?

jl:
Thanks, I can't seem to get fptimer to work.  in the above example, compiling with the line  "FTimer.on;"   shows a compilation error: identifier idents no member "on"

I used the example shown on this thread - http://readlist.com/lists/lists.freepascal.org/fpc-pascal/0/3900.html

Now I opened the file fptimer.pp in fcl-base, saw that there's a StartTimer, so I replaced  FTimer.on;  with FTimer.StartTimer;

Still not working.   :-\

by the way, the code is placed on  TDaemon1 = class(TDaemon)

Navigation

[0] Message Index

[#] Next page

Go to full version