Limitation in Length of File (1022 characters)?

From Navison Financials we will create a plain textfile with fixed format. The field specification is 1064 characters in total. So therefor we have tried this: theFile is a File variable, each Text is a Text variable. Total length is 1064 characters. theFile.WRITE(Text1 + Text2 +Text3 + Text4 + Text5); This gives a stack overflow from Navision… If we use a dataport the maximum characterlength we have managed to get out is 1022… Suggestions ?

Hmm, I can remember a similar problem I once encountered, but IIRC it had to do with reading a file. I think I solved it by reading it one character at the time, which was very slow, but that didn’t matter much. To make this work I had to open the file as a binary file. I think this would work for you aswell. Create the file as a binary file, and write the texts separately, just make sure you end each line with a CR/LF. Your problem is probably that NF will first add the five strings together resulting in one string of 1064 characters, which navision can’t handle. Succes Dennis van Es PerCom: Research & Development BV The Netherlands Edited by - Dennis on 2/2/00 11:19:25 AM Edited by - Dennis on 2/2/00 11:19:50 AM Edited by - Dennis on 2/2/00 11:21:31 AM

The maximum length of a text string in Navision is 250 bytes. Even though you don’t explicitly store the long string in a variable, Navision must create a text string temporary on the stack in order to pass the result to the function. Try setting the textmode to false before opening. Then write each string one at a time. Then write the New Line chanracter. -jp

If you write in “binary” mode, I think that additional NULL (char (0)) character is written