Chapter 14
Using functions and procedures

Free Pascal supports the use of functions and procedures. It supports

Remark In many of the subsequent paragraphs the words procedure and function will be used interchangeably. The statements made are valid for both, except when indicated otherwise.

14.1 Procedure declaration
14.2 Function declaration
14.3 Function results
14.4 Parameter lists
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
14.5 Function overloading
14.6 Forward declared functions
14.7 External functions
14.8 Assembler functions
14.9 Modifiers
14.9.1 alias
14.9.2 cdecl
14.9.3 cppdecl
14.9.4 export
14.9.5 hardfloat
14.9.6 inline
14.9.7 interrupt
14.9.8 iocheck
14.9.9 local
14.9.10 MS_ABI_Default
14.9.11 MS_ABI_CDecl
14.9.12 MWPascal
14.9.13 noreturn
14.9.14 nostackframe
14.9.15 overload
14.9.16 pascal
14.9.17 public
14.9.18 register
14.9.19 safecall
14.9.20 saveregisters
14.9.21 softfloat
14.9.22 stdcall
14.9.23 SYSV_ABI_Default
14.9.24 SYSV_ABI_CDecl
14.9.25 VectorCall
14.9.26 varargs
14.9.27 winapi
14.10 Unsupported Turbo Pascal modifiers