Difference between revisions of "Compiler Mode"

From Lazarus wiki
Jump to navigationJump to search
(German link)
(Add a list format and summary.)
Line 1: Line 1:
 
{{Compiler Mode}}
 
{{Compiler Mode}}
  
Free Pascal: {$MODE '''FPC'''}<br/>
+
The Free Pascal compiler will compile in a specific mode. Each mode dictates what syntax the compiler accepts as valid, and what it considers as invalid. The compiler mode can be set in the source code with the {$mode } compiler directive, or on the command line with the -M option.  
This is the original Free Pascal compiler mode. It is the default mode of the compiler.
 
  
Extended Free Pascal: {$MODE '''OBJFPC'''} <br/>
+
*Free Pascal: {$MODE '''FPC'''}<br/>This is the original Free Pascal compiler mode. It is the default mode of the compiler, so it is not necessary to explicitly add this directive.
This mode adds extra functionality to the FPC mode, including classes, interfaces and exceptions.
 
  
Turbo Pascal: {$MODE '''TP'''} <br/>
+
*Extended Free Pascal: {$MODE '''OBJFPC'''} <br/>This mode adds extra functionality to the FPC mode, including classes, interfaces and exceptions.
This is the Turbo Pascal compatibility mode.
 
  
Delphi: {$MODE '''DELPHI'''} <br/>
+
*Turbo Pascal: {$MODE '''TP'''} <br/>This is the Turbo Pascal compatibility mode.
This is the Delphi compatibility mode.  
 
  
Mac Pascal: {$ MODE '''MacPAS'''}<br/>
+
*Delphi:  {$MODE '''DELPHI'''} <br/>This is the Delphi compatibility mode.
The Mac Pascal compatibility mode.
+
 
 +
*Mac Pascal: {$ MODE '''MacPAS'''}<br/>The Mac Pascal compatibility mode.

Revision as of 06:40, 6 July 2016

Deutsch (de) English (en) español (es) suomi (fi) français (fr)

The Free Pascal compiler will compile in a specific mode. Each mode dictates what syntax the compiler accepts as valid, and what it considers as invalid. The compiler mode can be set in the source code with the {$mode } compiler directive, or on the command line with the -M option.

  • Free Pascal: {$MODE FPC}
    This is the original Free Pascal compiler mode. It is the default mode of the compiler, so it is not necessary to explicitly add this directive.
  • Extended Free Pascal: {$MODE OBJFPC}
    This mode adds extra functionality to the FPC mode, including classes, interfaces and exceptions.
  • Turbo Pascal: {$MODE TP}
    This is the Turbo Pascal compatibility mode.
  • Delphi: {$MODE DELPHI}
    This is the Delphi compatibility mode.
  • Mac Pascal: {$ MODE MacPAS}
    The Mac Pascal compatibility mode.