Chapter 6
Classes

In the Delphi approach to Object Oriented Programming, everything revolves around the concept of ’Classes’. A class can be seen as a pointer to an object, or a pointer to a record.

Remark: In earlier versions of Free Pascal it was necessary, in order to use classes, to put the objpas unit in the uses clause of a unit or program. This is no longer needed as of version 0.99.12. As of version 0.99.12 the system unit contains the basic definitions of TObject and TClass, as well as some auxiliary methods for using classes. The objpas unit still exists, and contains some redefinitions of basic types, so they coincide with Delphi types. The unit will be loaded automatically when the -S2 or -Sd options are specified.


 6.1 Class definitions
 6.2 Class instantiation
 6.3 Methods
  6.3.1 invocation
  6.3.2 Virtual methods
  6.3.3 Class methods
  6.3.4 Message methods
 6.4 Properties