Hi Bjarne,
Appeon didn’t modify the FileWrite function in PB 2017 / 2019. It is the same as SAP PB 12.6.
For the FileWrite function, you can refer to the link below for more details:
https://docs.appeon.com/appeon_online_help/pb2019r2/powerscript_reference/ch10s177.html
FileWrite is maintained for backward compatibility. Use the FileWriteEx function for new development.
If the file was opened in text mode, FileWrite returns -1. Use FileWriteEx to write to files in text mode.
https://docs.appeon.com/appeon_online_help/pb2019r2/powerscript_reference/ch10s172.html
The mode in which you open a file determines the behavior of the functions used to read and write to a file. There are two functions that read data from a file: FileRead and FileReadEx, and two functions that write data to a file: FileWrite and FileWriteEx. FileRead and FileWrite have limitations on the amount of data that can be read or written and are maintained for backward compatibility. They do not support text mode.
So,We recommend you to use FileWriteEx function.
Regards,
Ken