[fpc-pascal] Bug or feature ?

Sven Barth pascaldragon at googlemail.com
Wed Jul 27 22:07:00 CEST 2022


Am 27.07.2022 um 15:14 schrieb Ched via fpc-pascal:
> Hello All,
>
> I have a long code which include lines for writing stuffs into an 
> assigned writable text-file F.
>
>    WRITELN(F: 'Hello');
>
>    WRITELN(F, 'Hello');
>
> The code can be compiled with 3.2.2 in i386/windows and i386/linux and 
> runs both times at perfection. But... i'm wondering if the first line 
> is really legal... Any advice ?

Write(), WriteLn() and WriteStr() (and Str()) allow to adjust the way a 
numerical value is written by using additional parameters delimited by 
colons: VarToOutput:NumChars[:Decimals] (see 
https://www.freepascal.org/docs-html/current/rtl/system/write.html ). 
That it nevertheless compiles correctly and executes as "Writeln(F, 
'Hello')" is due to a bug in the handling of the parameters. So, please 
report a bug with a complete example that should fail.

Regards,
Sven


More information about the fpc-pascal mailing list