Contents

Chapter 1: Introduction
What's in this manual?
   Delphi and Object Pascal
   Typographical conventions
Other sources of information
Software registration and technical support

Part I: Basic language description

Chapter 2: Overview
Program organization
   Pascal source files
   Other files used to build applications
   Compiler-generated files
Example programs
   A simple console application
   A more complicated example
   A Windows application

Chapter 3: Programs and units
Program structure and syntax
   The program heading
   The program uses clause
   The block
Unit structure and syntax
   The unit heading
   The interface section
   The implementation section
   The initialization section
   The finalization section
Unit references and the uses clause
   The syntax of a uses clause
   Multiple and indirect unit references
   Circular unit references

Chapter 4: Syntactic elements
Fundamental syntactic elements
   Special symbols
   Identifiers
      Qualified identifiers
   Reserved words
   Directives
   Numerals
   Labels
   Character strings
Comments and compiler directives
Expressions
   Operators
      Arithmetic operators
      Boolean operators
      Logical (bitwise) operators
      String operators
      Pointer operators
      Set operators
      Relational operators
      Class operators
      The @ operator
      Operator precedence rules
   Function calls
   Set constructors
   Indexes
   Typecasts
      Value typecasts
      Variable typecasts
Declarations and statements
   Declarations
   Statements
   Simple statements
      Assignment statements
      Procedure and function calls
      Goto statements
   Structured statements
      Compound statements
      With statements
      If statements
      Case statements
      Control loops
      Repeat statements
      While statements
      For statements
Blocks and scope
   Blocks
   Scope
      Naming conflicts

Chapter 5: Data types, variables, and constants
About types
Simple types
   Ordinal types
      Integer types
      Character types
      Boolean types
      Enumerated types
      Subrange types
   Real types
String types
   Short strings
   Long strings
   WideString
      About extended character sets
   Working with null-terminated strings
      Using pointers, arrays, and string constants
      Mixing Pascal strings and null-terminated strings
Structured types
   Sets
   Arrays
      Static arrays
      Dynamic arrays
      Array types and assignments
   Records
      Variant parts in records
   File types
Pointers and pointer types
   Overview of pointers
   Pointer types
      Character pointers
      Other standard pointer types
Procedural types
   Procedural types in statements and expressions
Variant types
   Variant type conversions
   Variants in expressions
   Variant arrays
   OleVariant
Type compatibility and identity
   Type identity
   Type compatibility
   Assignment-compatibility
Declaring types
Variables
   Declaring variables
      Absolute addresses
      Dynamic variables
      Thread-local variables
Declared constants
   True constants
      Constant expressions
      Resource strings
   Typed constants
      Array constants
      Record constants
      Procedural constants
      Pointer constants

Chapter 6: Procedures and functions
Declaring procedures and functions
   Procedure declarations
   Function declarations
   Calling conventions
   Forward and interface declarations
   External declarations
      Linking to .OBJ files
      Importing functions from DLLs
   Overloading procedures and functions
   Local declarations
      Nested routines
Parameters
   Parameter semantics
      Value and variable parameters
      Constant parameters
      Out parameters
      Untyped parameters
   String parameters
   Array parameters
      Open array parameters
      Variant open array parameters
   Default parameters
      Default parameters and overloaded routines
      Default parameters in forward and interface declarations
Calling procedures and functions
   Open array constructors

Chapter 7: Classes and objects
Class types
   Inheritance and scope
      TObject and TClass
      Compatibility of class types
      Object types
   Visibility of class members
      Private, protected, and public members
      Published members
      Automated members
   Forward declarations and mutually dependent classes
Fields
Methods
   Method implementations
      Inherited
      Self
   Method binding
      Static methods
      Virtual and dynamic methods
      Abstract methods
   Overloading methods
   Constructors
   Destructors
   Message handlers
      Implementing message handlers
      Message dispatching
Properties
   Property access
   Array properties
   Index specifiers
   Storage specifiers
   Property overrides and redeclarations
Class references
   Class-reference types
      Constructors and class references
   Class operators
      The is operator
      The as operator
   Class methods
Exceptions
   Declaring exception types
   Raising and handling exceptions
      Try...except statements
      Re-raising exceptions
      Nested exceptions
      Try...finally statements
   Standard exception classes and routines

Chapter 8: Standard routines and I/O
File input and output
   Text files
   Untyped files
Text-file device drivers
   Device functions
      The Open function
      The InOut function
      The Flush function
      The Close function
Handling null-terminated strings
   Wide-character strings
Other standard routines

Part II: Special topics

Chapter 9: Dynamic-link libraries and packages
Calling DLLs
      Static loading
      Dynamic loading
Writing DLLs
   The exports clause
   Library initialization code
   Global variables in a DLL
   DLLs and System variables
   Exceptions and runtime errors in DLLs
   The shared-memory manager
Packages
   Package declarations and source files
      Naming packages
      The requires clause
      The contains clause
   Compiling packages
      Generated files
      Package-specific compiler directives
      Package-specific command-line compiler switches

Chapter 10: Object interfaces
Interface types
   IUnknown and inheritance
   Interface identification
   Calling conventions
   Interface properties
   Forward declarations
Implementing interfaces
   Method resolution clauses
   Changing inherited implementations
   Implementing interfaces by delegation
      Delegating to an interface-type property
      Delegating to a class-type property
Interface references
   Interface assignment-compatibility
   Interface typecasts
      Interface querying
Automation objects
   Dispatch interface types
      Dispatch interface methods
      Dispatch interface properties
   Accessing Automation objects
      Automation object method-call syntax
   Dual interfaces

Chapter 11: Memory management
Delphi's memory manager
   Variables
Internal data formats
   Integer types
   Character types
   Boolean types
   Enumerated types
   Real types
      The Real48 type
      The Single type
      The Double type
      The Extended type
      The Comp type
      The Currency type
   Pointer types
   Short string types
   Long string types
   Wide string types
   Set types
   Static array types
   Dynamic array types
   Record types
   File types
   Procedural types
   Class types
   Class reference types
   Variant types

Chapter 12: Program control
Parameters and function results
   Parameter passing
      Register saving conventions
   Function results
   Method calls
      Constructors and destructors
Exit procedures

Chapter 13: Inline assembler code
The asm statement
   Register use
Assembler statement syntax
   Labels
   Instruction opcodes
      RET instruction sizing
      Automatic jump sizing
   Assembler directives
   Operands
Expressions
   Differences between Object Pascal and assembler expressions
   Expression elements
      Constants
      Registers
      Symbols
   Expression classes
   Expression types
   Expression operators
Assembler procedures and functions

Appendix A: Object Pascal grammar


© 1999 by INPRISE Corporation, Inc.
All Rights Reserved