[fpc-pascal] $modeswitch from command line

zh loza zhloza at gmail.com
Tue Feb 4 09:58:22 CET 2020


I personally find it very convenient to have a global include file for such
features.
E.g. we have a global.inc with {$mode objfpc}{$modeswitch advancedrecords}
and include it {$include global.inc} in every file of our project. This way
we can easily modify a lot of compiler directives / macros that would
affect all the units.

On Tue, Feb 4, 2020 at 10:41 AM 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.
>
> Is it possible?
>
> Thank you.
>
> Regards,
>
>
> –Mr Bee
>
>
>
> Pada Selasa, 4 Februari 2020 13.42.10 WIB, Sven Barth via fpc-pascal <
> fpc-pascal at lists.freepascal.org> menulis:
>
>
> Am 03.02.2020 um 23:19 schrieb Mr Bee via fpc-pascal:
> > Hi all,
> >
> > Is there a way to enable a mode switches from fpc command line?
> >
>
> Yes, using -M<x>, however these are discarded as soon as a $Mode
> directive is read (just like any $Mode directive resets any $Modeswitch
> directive).
>
>
> Regards,
>
> Sven
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200204/3b30e3e9/attachment.html>


More information about the fpc-pascal mailing list