2009/5/26 <a.sangui...@gmail.com>: > > if cbOnStatusCMD.Checked then > FTP.OnStatus:=callback.StatusCMD > else > FTP.OnStatus:=nil; > > compile fine. > But if I set {$mode objfpc} rather than delphi I got: > > main.pas(262,3) Error: Wrong number of parameters specified for call to > "StatusCMD"
You need to assign the address of that method in objfpc mode using the @ syntax. FTP.OnStatus:=callba...@statuscmd or was it... FTP.OnStatus:=...@callback.statuscmd Something like that. I can never remember which. ;-) > Is there a way to compile with objfpc or better which is the difference > between two modes for this case ? I prefer objfpc mode as it's a lot stricter than delphi mode. But if you work on shared code projects that must compile under Delphi and FPC, it is just easier (and cleaner) to use delphi mode. Otherwise you sit with a lot of {$IFDEF FPC} entries. Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal