ExportFileName.TEXTMODE(FALSE); OutputText.ADDTEXT(sometext); ExportFileName.CREATEOUTSTREAM(OutStr); OutputText.WRITE(OutStr); ExportFileName.write(LF); ExportFileName.write(CR); ExportFileName.CLOSE;
ExportFileName.TEXTMODE(FALSE); OutputText.ADDTEXT(sometext); ExportFileName.CREATEOUTSTREAM(OutStr); OutputText.WRITE(OutStr); ExportFileName.CLOSE; ExportFileName.OPEN(NameofExportFile); ExportFileName.TEXTMODE(FALSE); ExportFileName.SEEK(ExportFileName.LEN); ExportFileName.WRITE(LF); ExportFileName.WRITE(CR); ExportFileName.CLOSE;
ExportFileName.TEXTMODE(TRUE); OutputText.ADDTEXT(sometext); ExportFileName.CREATEOUTSTREAM(OutStr); OutputText.WRITE(OutStr); OutputText.WRITE('');
Answers
strange thing this... I looked it up. For writing overlong lines I am using code which writes 1024char-chunks (maximum text variable), and reposition the file position before the trailing CR/LF for the next chunk. The outfile is written in textmode, no OUTSTREAM. This way you always get a CR/LF on the line's end.
with best regards
Jens
Anyone have any experience using Outstream and added the carriage return?
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
after OutStream.Write(), do a
You can also write the CR/LF as bytes from a string (in binary mode). The catch is to not use the OutStream for it.
with best regards
Jens
Hi Jens,
Thanks for the reply. But as you can see from the sample I provided above, I tried these codes, but it didn't work.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
you're right, I just tried it out - only works once at the end of the file. However, it works directly with BigText when you ADDTEXT the CR/LF into the BigText:
with best regards
Jens
Your next round of drinks is on me whenenver I meet you. :thumbsup:
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book