[Lazarus] Newbie, porting class to FPC but get procedure assignment error
Luca Olivetti
luca at wetron.es
Fri Jun 19 09:38:01 CEST 2015
El 19/06/15 a les 09:25, Bo Berglund ha escrit:
> constructor TSentinel.Create;
> begin
> FTimer := TTimer.Create(Application);
> FTimer.Enabled := false;
> FTimer.Interval := 0;
> FTimer.OnTimer := OnCheckTimer(Self); //<= Error here
> ...
>
> Why is this difference Delphi/FPC appearing and what can I do?
>
Either you use {$MODE DELPHI} or you prepend the method with @, i.e.
FTimer.OnTimer := @OnCheckTimer
See:
http://wiki.freepascal.org/Code_Conversion_Guide
Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007
More information about the Lazarus
mailing list