[fpc-pascal] $modeswitch from command line
pak.lebah at yahoo.com
Wed Feb 5 10:45:54 CET 2020
It’s a great info, Jonas. Thank you.
I didn’t know FPC has -M option for $modeswitch. Based on the official document¹, the -M option is to select language modes, not language features.
I know changing language mode would reset mode switches. It’s no problem for me because I wrote the code and I stick to ObjFPC mode for all the code, no exception. But I want to use advanced record feature as well. By setting the language mode and language features in the global config, I don’t need to write them in every single file.
_____¹ A Alphabetical listing of command line options
A Alphabetical listing of command line options
Pada Rabu, 5 Februari 2020 02.30.04 WIB, Jonas Maebe <jonas at freepascal.org> menulis:
On 04/02/2020 10:06, Mattias Gaertner via fpc-pascal wrote:
> 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:
$ cat tt.pp
tr = record
$ fpc -MObjFPC -Madvancedrecords -Mansistrings -Mnestedcomments- tt
Free Pascal Compiler version 3.0.4 [2018/09/30] for x86_64
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Darwin for x86_64
Assembling (pipe) tt.s
16 lines compiled, 0.1 sec
Setting a different mode resets all modeswitches to the default for that
mode (since that's one of the main points of a mode). Setting a
different modeswitch does not reset anything.
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal