The mode ObjFPC, switched on with {$mode objfpc} in source code, or -Mobjfpc on the command line, is the default mode for Lazarus source files (the default compiler mode when not using Lazarus is FPC mode).
Using the ObjFPC mode has the following consequences:
- The address operator has to be used to assign procedural variables. Use
{$modeswitch classicProcVars+}to disable this requirement. - A forward declaration must be repeated exactly the same by the implementation of a
function/procedure. In particular, parameters cannot be omitted when implementing the function or procedure, and the calling convention must be repeated as well. - Overloading of functions is allowed.
- Nested comments are allowed.
- The Objpas unit is loaded right after the system unit. One of the consequences of this is that the type
integeris redefined aslongint. - The
cvartype may be used. PChars are converted tostrings automatically.- Parameters in class methods cannot have the same names as class properties.
- Strings are
shortstrings by default. This may be changed by using the-Shcommand line switch or the{$H+}switch. - Exceptions, classes and Interfaces are enabled.
- Inline code is allowed: There is no need to enable it with the
{$INLINE}directive.