[fpc-pascal] Strings - suggestions

Michael Van Canneyt michael at freepascal.org
Sat Dec 22 17:53:46 CET 2012



On Sat, 22 Dec 2012, Marco van de Voort wrote:

> In our previous episode, dev.dliw at gmail.com said:
>> Users can define the internal type with e.g. {$STRING UTF8} for their *whole*
>> project.
>
> This is technically impossible. Both FPC and Lazarus don't have a complete
> overview of all units and includefiles in a project, and compiles can also
> be parts of program.
>
> Rule of thumb: anything global must be passed on the cmdline everytime, and
> directives are only for unit level. (a few special ones for library units
> like $libsuffix excluded)

While this is correct, I think it is possible to construct a (new) directive that 
can be inserted in a program/library file only, and which will have the same 
effect as the command-line argument: for all units that will be compiled as 
part of the normal run, the string type is set.

Whether or not this is desirable, is another matter.

(personally, I think we have enough with the command-line version)

Michael.



More information about the fpc-pascal mailing list