[fpc-pascal] $modeswitch from command line

Mr Bee pak.lebah at yahoo.com
Tue Feb 4 09:41:22 CET 2020

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.

–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 

fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200204/e0518637/attachment-0001.html>

More information about the fpc-pascal mailing list