14.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.

_________________________________________________________________________________________________________
Parameters

--formal- parameter- list----------------------------------------------
                     (  --                 ---|)
                         -parameter- d;eclaration--|

--parameter- declaration----value- parameter-----------------------------
                    --variable- parameter-|
                    -coonustta- pnatr- paamreamteerter--|
                    ---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.

  14.4.1 Value parameters
  14.4.2 Variable parameters
  14.4.3 Out parameters
  14.4.4 Constant parameters
  14.4.5 Open array parameters
  14.4.6 Macpas: UNIV typed parameters
  14.4.7 Array of const
  14.4.8 Untyped parameters
  14.4.9 Ellipsis parameter
  14.4.10 Managed types and reference counts