Difference between revisions of "modeswitch"

From Lazarus wiki
Jump to navigationJump to search
(Created page with "As of FPC 2.3.1, the '''{$MODESWITCH}''' directive can be used to select some of the features that a '''{$MODE }''' directive would select. It can be used to enable language...")
 
m (Categorised page)
Line 23: Line 23:
 
'''More detailed information:'''
 
'''More detailed information:'''
 
* [https://www.freepascal.org/docs-html/3.2.0/prog/progsu106.html#x114-1150001.3.22 $modeswitch] (extern)
 
* [https://www.freepascal.org/docs-html/3.2.0/prog/progsu106.html#x114-1150001.3.22 $modeswitch] (extern)
 +
 +
[[Category:FPC]]
 +
[[Category:Modes]]

Revision as of 08:12, 2 August 2020

As of FPC 2.3.1, the {$MODESWITCH} directive can be used to select some of the features that a {$MODE } directive would select.

It can be used to enable language features that would otherwise not be available in the current mode. For example, you might be programming in TP mode, but want to use the Out parameters, which are only available in Delphi mode.

The {$MODESWITCH } directive enables or disables individual mode features without changing the current compiler mode.

This switch is a global switch, and can be used wherever the {$MODE} switch can be used.

The syntax is as follows:

{$MODESWITCH XXX}  
{$MODESWITCH XXX+}  
{$MODESWITCH XXX-}


The first two will switch on feature XXX, the last one will switch it off.

The feature XXX can be one of the following:


More detailed information: