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   --ssimtprilneg t tyyppee--|
        -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
  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