D.5 OBJFPC mode

This mode is selected by the $MODE OBJFPC switch. On the command line, this mode is selected by the -Mobjfpc switch.

  1. Exceptions, classes and Interfaces are enabled.
  2. You must use the address operator to assign procedural variables.
  3. A forward declaration must be repeated exactly the same by the implementation of a function/procedure. In particular, you cannot omit the parameters when implementing the function or procedure, and the calling convention must be repeated as well.
  4. Overloading of functions is allowed.
  5. Nested comments are allowed.
  6. The Objpas unit is loaded right after the system unit. One of the consequences of this is that the type Integer is redefined as Longint.
  7. You can use the cvar type.
  8. PChars are converted to strings automatically.
  9. Parameters in class methods cannot have the same names as class properties.
  10. Strings are shortstrings by default. You can use the -Sh command line switch or the {$H+} switch to change this.