[fpc-pascal] Events doesn't work in .lpr ?

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Dec 11 11:20:39 CET 2009

On 11 Dec 2009, at 11:15, Benedikt Schindler wrote:

> The source Code is very short. So i just atached the hole cource code.
> i got 2 compiler messsages and i think they are directly connected.
> Here they are:
> SCServer.lpr(46,43) Error: Wrong number of parameters specified for  
> call to "DoOnReciveCommand"
> SCServer.lpr(33,21) Hint: Found declaration:  
> TSCServer.DoOnReciveCommand(TLSocket)
> Now my question:
> Why does it say "Found declaration DoOnReciveCommand"?

It says this because you are trying to call DoOnReciveCommand without  
any parameters. The compiler is trying to help you by saying that it  
only knows of a method with that name that has one parameter.

> I mean it is declared 4 lines earlier. where is the difference to  
> the procedure DoRun ?

The problem is that you are using Delphi/TP-style procvar syntax in  
source code compiled {$mode objfpc}. Either add @ in front of  
DoOnReciveCommand when assigning it to DoRun, or change {$mode objfpc}  
into {$mode delphi}.


More information about the fpc-pascal mailing list