LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Do I need to close the file before issuing PrintTextFile command?

I need to write to a file as I receive test results and then print the results from the file as I receive them.  I am planning on using PrintTextFile and I was wondering whether anyone knows whether I can leave the file open and issue the PrintTextFile command?  Would I be better off using PrintTextBuffer?  
Thanks,
Donna
0 Kudos
Message 1 of 2
(2,868 Views)
Hello donna,

If you are trying to print a file with the PrintTextFile function, you do need to close the file handle beforehand or you will get a file access error.  If you instead already have the content of the text file in a buffer, potentially the buffer you pass to fwrite, you can instead pass this buffer to the PrintTextBuffer function before/instead of writing it to a file. 

Hope that helps.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 2 of 2
(2,842 Views)