modeswitch

From Free Pascal wiki
Revision as of 14:16, 30 July 2020 by Mathias (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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: