[fpc-pascal] $modeswitch from command line

Mattias Gaertner nc-gaertnma at netcologne.de
Tue Feb 4 10:06:41 CET 2020


On Tue, 4 Feb 2020 08:41:22 +0000 (UTC)
Mr Bee via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:

> As mention in the email title, what I meant is {$modeswitch} not
> {$mode} as explain
> here: https://www.freepascal.org/docs-html/prog/progsu105.html
> 
> For example, if I want to use extended record in objfpc mode, then I
> have to define {$mode objfpc}{$modeswitch advancedrecords}
> in every single file that using the feature. I prefer to put it in a
> config file or call it from command line, as default setting, so my
> code is cleaner from such things.

As Sven explained a $mode resets all modeswitches.
What you need is a switch to alter modeswitch of a mode. And
there is currently no such switch.

For example a syntax could be:
-MObjFPC+AdvancedRecords+AnsiStrings-NestedComments

Mattias


More information about the fpc-pascal mailing list