Chapter 3
Types

All variables have a type. Free Pascal supports the same basic types as Turbo Pascal, with some extra types from Delphi. The programmer can declare his own types, which is in essence defining an identifier that can be used to denote this custom type when declaring variables further in the source code.

_________________________________________________________________________________________________________ Type declaration
-- type declaration-identifier- = - type- ;------------------------------
___________________________________________________________________

There are 7 major type classes :

_________________________________________________________________________________________________________ Types
-- type-----simple type ---------------------------------------------
        |--string type---|
        |structured type|
        |-pointer type--|
        |procedural type|
        --type identifier--
___________________________________________________________________

The last class, type identifier, is just a means to give another name to a type. This presents a way to make types platform independent, by only using these types, and then defining these types for each platform individually. The programmer that uses these units doesn’t have to worry about type size and so on. It also allows to use shortcut names for fully qualified type names. e.g. define system.longint as Olongint and then redefine longint.


 3.1 Base types
   Ordinal types
   Real types
 3.2 Character types
   Char
   Strings
   Short strings
   Ansistrings
   Constant strings
   PChar - Null terminated strings
 3.3 Structured Types
   Arrays
   Record types
   Set types
   File types
 3.4 Pointers
 3.5 Forward type declarations
 3.6 Procedural types