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
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to