I am trying to write some command codes to a text file and Navision seems to want add some of its own. My code reads: Variables - ESC Char LF Char NUL Char ESC := 27; LF := 10; NUL := 0; Line 1 := Format(ESC)+ ‘C’ + Format(LF) + Format(NUL); I expected to get : [ESC]C[LF][NUL] What I got was : [ESC] C [CR][LF][CR][LF] Has anyone else come across this ??? Any Suggestions ???
Is the file in binary mode?
If you are writing in textmode then each write is followed by a CR/LF. In binary mode each variable is output individually (for example, an integer would be output as a 4-byte binary integer in its internal format). However, text and code data are converted to the “standard” form of a null terminated string. Try exporting through a variable of the char data type one character at a time. f.TEXTMODE(FALSE); f.CREATE(‘test.txt’); ch := 27; f.WRITE(ch); ch := ‘C’; f.WRITE(ch); ch := 10; f.WRITE(ch); ch := 0; f.WRITE(ch); f.CLOSE;