Sign in Join
Wiki copytemporary

FPC message: Wrong number of parameters specified

Deutsch · English

Missing parameter or too many parameters

You confused the function and forgot a parameter or added a parameter too much.

Missing @

For example:

pascal
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:

pascal
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}.


From the Free Pascal wiki, page "FPC message: Wrong number of parameters specified", as it stood on 2020-02-16 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Edited on wiki.freepascal.org by 8 people, 2006–2020

From the official wiki's backup of 26 May 2024: who edited this page there, and when. Edits made there after that date were not recorded, and the earlier versions are not shown here; the main page says why.

WhenWhoWhat changed
Mattias2
Mattias2Missing @
Swen (minor)
Chronossyntaxhighlight
Socke+Category:Compiler Messages; replace translation template
FTurtle
Arent
FTurtle (minor)
FTurtle
Kai Burghardtcopymove from FPC message: Wrong number of parameters specified (minor)
TrevFixed syntax highlighting; deleted category included in page template (minor)

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.