LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create a new txt file in labwindows?

Hi. I am trying to create a new txt file using labwindows 6.0. I have tryed whith CreateAndOpenTemporaryFile function but it does'n work.

Thanks.
0 Kudos
Message 1 of 3
(12,406 Views)
You can try the following functions-
fopen(filename,mode); -to create a new file
LaunchExecutable ("notepad.exe filename"); - to open the file

Hope this helps

Regrads,
siddu
Message 2 of 3
(12,406 Views)
If the content of the file is to be created by the CVI program (such as test results, configuration information and so on), you can use the following instructions:

fH = OpenFile ("filename.txt", VAL_WRITE_ONLY, VAL_APPEND, VAL_ASCII);
// Create the string to be written to the file
WriteLine (fH, string, -1);
CloseFile (fH);

Or, if you don't want to write line-by-line, you can use WriteFile (fH, string, strlen (string));
When you want to intruce a linefeed in the file you must write a "\n" to it.

Hope this helps
Roberto


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?
Message 3 of 3
(12,406 Views)