Free Pascal :
Reference guide.


_____________________________________________________________________
Reference guide for Free Pascal, version 2.2.4
Document version 2.2.4
March 2009

Michaėl Van Canneyt

____________________________________________________________________________
Contents
List of Tables
 About this guide
  Notations
  Syntax diagrams
1 Pascal Tokens
 1.1 Symbols
 1.2 Comments
 1.3 Reserved words
  1.3.1 Turbo Pascal reserved words
  1.3.2 Delphi reserved words
  1.3.3 Free 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
  3.2.2 Strings
  3.2.3 Short strings
  3.2.4 Ansistrings
  3.2.5 WideStrings
  3.2.6 Constant strings
  3.2.7 PChar - Null terminated strings
 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
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 Methods
  6.3.1 Declaration
  6.3.2 invocation
  6.3.3 Virtual methods
  6.3.4 Class methods
  6.3.5 Message methods
  6.3.6 Using inherited
 6.4 Properties
7 Interfaces
 7.1 Definition
 7.2 Interface identification: A GUID
 7.3 Interface implementations
 7.4 Interfaces and COM
 7.5 CORBA and other Interfaces
8 Generics
 8.1 Introduction
 8.2 Generic class definition
 8.3 Generic class specialization
 8.4 A word about scope
9 Expressions
 9.1 Expression syntax
 9.2 Function calls
 9.3 Set constructors
 9.4 Value typecasts
 9.5 Variable typecasts
 9.6 Unaligned typecasts
 9.7 The @ operator
 9.8 Operators
  9.8.1 Arithmetic operators
  9.8.2 Logical operators
  9.8.3 Boolean operators
  9.8.4 String operators
  9.8.5 Set operators
  9.8.6 Relational operators
  9.8.7 Class operators
10 Statements
 10.1 Simple statements
  10.1.1 Assignments
  10.1.2 Procedure statements
  10.1.3 Goto statements
 10.2 Structured statements
  10.2.1 Compound statements
  10.2.2 The Case statement
  10.2.3 The If..then..else statement
  10.2.4 The For..to/downto..do statement
  10.2.5 The Repeat..until statement
  10.2.6 The While..do statement
  10.2.7 The With statement
  10.2.8 Exception Statements
 10.3 Assembler statements
11 Using functions and procedures
 .1Procedure declaration
 .2Function declaration
 .3Function results
 .4Parameter lists
  .4.1Value parameters
  .4.2Variable parameters
  .4.3Out parameters
  .4.4Constant parameters
  .4.5Open array parameters
  .4.6Array of const
 .5Function overloading
 .6Forward defined functions
 .7External functions
 .8Assembler functions
 .9Modifiers
  .9.1alias
  .9.2cdecl
  .9.3export
  .9.4inline
  .9.5interrupt
  .9.6local
  .9.7nostackframe
  .9.8overload
  .9.9pascal
  .9.10public
  .9.11register
  .9.12safecall
  .9.13saveregisters
  .9.14softfloat
  .9.15stdcall
  .9.16varargs
 .10Unsupported Turbo Pascal modifiers
12 Operator overloading
 12.1 Introduction
 12.2 Operator declarations
 12.3 Assignment operators
 12.4 Arithmetic operators
 12.5 Comparision operator
13 Programs, units, blocks
 13.1 Programs
 13.2 Units
 13.3 Unit dependencies
 13.4 Blocks
 13.5 Scope
  13.5.1 Block scope
  13.5.2 Record scope
  13.5.3 Class scope
  13.5.4 Unit scope
 13.6 Libraries
14 Exceptions
 14.1 The raise statement
 14.2 The try...except statement
 14.3 The try...finally statement
 14.4 Exception handling nesting
 14.5 Exception classes
15 Using assembler
 15.1 Assembler statements
 15.2 Assembler procedures and functions
Index