Free Pascal :
Reference guide.


_____________________________________________________________________
Reference guide for Free Pascal, version 2.6.4
Document version 2.6
March 2014

Michaėl Van Canneyt

____________________________________________________________________________
Contents
List of Tables
 About this guide
  Notations
  Syntax diagrams
 About the Pascal language
1 Pascal Tokens
 1.1 Symbols
 1.2 Comments
 1.3 Reserved words
  1.3.1 Turbo Pascal reserved words
  1.3.2 Free Pascal reserved words
  1.3.3 Object Pascal reserved words
  1.3.4 Modifiers
 1.4 Identifiers
 1.5 Hint directives
 1.6 Numbers
 1.7 Labels
 1.8 Character strings
2 Constants
 2.1 Ordinary constants
 2.2 Typed constants
 2.3 Resource strings
3 Types
 3.1 Base types
  3.1.1 Ordinal types
  3.1.2 Real types
 3.2 Character types
  3.2.1 Char or AnsiChar
  3.2.2 WideChar
  3.2.3 Other character types
  3.2.4 Strings
  3.2.5 Short strings
  3.2.6 Ansistrings
  3.2.7 UnicodeStrings
  3.2.8 WideStrings
  3.2.9 Constant strings
  3.2.10 PChar - Null terminated strings
  3.2.11 String sizes
 3.3 Structured Types
  3.3.1 Arrays
  3.3.2 Record types
  3.3.3 Set types
  3.3.4 File types
 3.4 Pointers
 3.5 Forward type declarations
 3.6 Procedural types
 3.7 Variant types
  3.7.1 Definition
  3.7.2 Variants in assignments and expressions
  3.7.3 Variants and interfaces
 3.8 Type aliases
4 Variables
 4.1 Definition
 4.2 Declaration
 4.3 Scope
 4.4 Initialized variables
 4.5 Thread Variables
 4.6 Properties
5 Objects
 5.1 Declaration
 5.2 Fields
 5.3 Static fields
 5.4 Constructors and destructors
 5.5 Methods
  5.5.1 Declaration
  5.5.2 Method invocation
 5.6 Visibility
6 Classes
 6.1 Class definitions
 6.2 Class instantiation
 6.3 Class destruction
 6.4 Methods
  6.4.1 Declaration
  6.4.2 invocation
  6.4.3 Virtual methods
  6.4.4 Class methods
  6.4.5 Class constructors and destructors
  6.4.6 Static class methods
  6.4.7 Message methods
  6.4.8 Using inherited
 6.5 Properties
  6.5.1 Definition
  6.5.2 Indexed properties
  6.5.3 Array properties
  6.5.4 Default properties
  6.5.5 Storage information
  6.5.6 Overriding properties
 6.6 Class properties
 6.7 Nested types, constants and variables
7 Interfaces
 7.1 Definition
 7.2 Interface identification: A GUID
 7.3 Interface implementations
 7.4 Interface delegation
 7.5 Interfaces and COM
 7.6 CORBA and other Interfaces
 7.7 Reference counting
8 Generics
 8.1 Introduction
 8.2 Generic class definition
 8.3 Generic class specialization
 8.4 A word about type compatibility
 8.5 A word about scope
9 Extended records
 9.1 Definition
 9.2 Extended record enumerators
10 Class and record helpers
 10.1 Definition
 10.2 Restrictions on class helpers
 10.3 Restrictions on record helpers
 10.4 Inheritance
 10.5 Usage
11 Objective-Pascal Classes
 11.1 Introduction
 11.2 Objective-Pascal class declarations
 11.3 Formal declaration
 11.4 Allocating and de-allocating Instances
 11.5 Protocol definitions
 11.6 Categories
 11.7 Name scope and Identifiers
 11.8 Selectors
 11.9 The id type
 11.10 Enumeration in Objective-C classes
12 Expressions
 12.1 Expression syntax
 12.2 Function calls
 12.3 Set constructors
 12.4 Value typecasts
 12.5 Variable typecasts
 12.6 Unaligned typecasts
 12.7 The @ operator
 12.8 Operators
  12.8.1 Arithmetic operators
  12.8.2 Logical operators
  12.8.3 Boolean operators
  12.8.4 String operators
  12.8.5 Set operators
  12.8.6 Relational operators
  12.8.7 Class operators
13 Statements
 13.1 Simple statements
  13.1.1 Assignments
  13.1.2 Procedure statements
  13.1.3 Goto statements
 13.2 Structured statements
  13.2.1 Compound statements
  13.2.2 The Case statement
  13.2.3 The If..then..else statement
  13.2.4 The For..to/downto..do statement
  13.2.5 The For..in..do statement
  13.2.6 The Repeat..until statement
  13.2.7 The While..do statement
  13.2.8 The With statement
  13.2.9 Exception Statements
 13.3 Assembler statements
14 Using functions and procedures
 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 Array of const
 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 export
  14.9.4 inline
  14.9.5 interrupt
  14.9.6 iocheck
  14.9.7 local
  14.9.8 noreturn
  14.9.9 nostackframe
  14.9.10 overload
  14.9.11 pascal
  14.9.12 public
  14.9.13 register
  14.9.14 safecall
  14.9.15 saveregisters
  14.9.16 softfloat
  14.9.17 stdcall
  14.9.18 varargs
 14.10 Unsupported Turbo Pascal modifiers
15 Operator overloading
 15.1 Introduction
 15.2 Operator declarations
 15.3 Assignment operators
 15.4 Arithmetic operators
 15.5 Comparison operator
 15.6 In operator
16 Programs, units, blocks
 16.1 Programs
 16.2 Units
 16.3 Unit dependencies
 16.4 Blocks
 16.5 Scope
  16.5.1 Block scope
  16.5.2 Record scope
  16.5.3 Class scope
  16.5.4 Unit scope
 16.6 Libraries
17 Exceptions
 17.1 The raise statement
 17.2 The try...except statement
 17.3 The try...finally statement
 17.4 Exception handling nesting
 17.5 Exception classes
18 Using assembler
 18.1 Assembler statements
 18.2 Assembler procedures and functions
Index