Missing parameter or too many parameters
editYou confused the function and forgot a parameter or added a parameter too much.
Missing @
editFor example:
Button1.Click := Button1Click;
In {$mode objfpc} you must add the @-address-operator to tell the compiler, that you want the pointer to the function, not the result of the function:
Button1.Click := @Button1Click;
Delphi users often confuse this, because Delphi allows it and adds the @ internally.
If you prefer the Delphi syntax you can use {$mode Delphi} instead of {$mode ObjFPC}, or use the mode switch {$modeswitch classicprocvars on}.