LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

WriteFile in ASCI mode writes a CR CR LF if I pass a CR LF.

 
0 Kudos
Message 1 of 4
(4,265 Views)

Taken from online documentation for OpenFile (File Type parameter):

fileType

integer

Specifies whether to treat the data in the file as ASCII or binary. When you perform I/O on a file in binary mode, carriage returns (CR) and linefeeds (LF) receive no special treatment. When you open the file in ASCII mode, each CR/LF combination translates to an LF when reading, and each LF translates to a CR/LF combination when writing

 

WriteLine does not need any line feed at the end of the string since it appends the correct line termination itself. Since you are appending a CR/LF at the end of your string, the last LF is translated to a CR/LF thus resulting in what you are seeing. Try adding anything to the string.

Message Edited by Roberto Bozzolo on 05-16-2007 07:10 AM



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(4,249 Views)
I am getting the data from 2 differant sources 1 has CR LF, 1 has just LF.  Do you think it would work to use both ASCII or Binary writes for the differant data sources to the same file?
0 Kudos
Message 3 of 4
(4,230 Views)
Couldn't you simply remove any CR/LF character prior to pass the string to WriteLine?


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 4
(4,213 Views)