11.4 Parameter lists

When arguments must be passed to a function or procedure, these parameters must be declared in the formal parameter list of that function or procedure. The parameter list is a declaration of identifiers that can be referred to only in that procedure or function’s block.


--formal parameter list (--parameter declaration--)--------------------
                       --------; ---------|

--                 ----            ------------------------------
  parameter declaration -- value parameter--|
                    --varoiaubtl pea praarammeetetrer-|
                    -constant parameter-|
                    ---out parameter---|

Constant parameters, out parameters and variable parameters can also be untyped parameters if they have no type identifier.

As of version 1.1, Free Pascal supports default values for both constant parameters and value parameters, but only for simple types. The compiler must be in OBJFPC or DELPHI mode to accept default values.

  11.4.1 Value parameters
  11.4.2 Variable parameters
  11.4.3 Out parameters
  11.4.4 Constant parameters
  11.4.5 Open array parameters
  11.4.6 Array of const