LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

text file operation....

So I use this standart code to save some textual data into a text file. Everything works fine. But I want to implement one additional feature like if the user selects an existing file I want the program to append the existing file instead of overwriting it.

The second feauture I want  to implement is that if a user saves data I want the program to  remember the folder path where the user saved the data so that during the next run the program will offer to write in the same folder or even file.  Should i use and .ini file for this or something?
Please see my current simple code.


0 Kudos
Message 1 of 8
(3,545 Views)
Hi RSibagatuâ€Ĥ,
to append data you can use the "?? set cursor vi (in 7.1 it´s called seek)" to set the write position to the end of the file. If you want to use the path more than ones while the vi is running, then you can store it in a shift register, otherwise you can write it to an ini file.

Mike

Message Edited by MikeS81 on 06-17-2008 11:28 PM
Message 2 of 8
(3,540 Views)
For the first part: you need to use the Set File Position function to set the marker to the end of the file prior to writing if you wish to append to the file.

For the second part: An INI file will work just fine for that.
Message 3 of 8
(3,539 Views)
So eventually I want to turn my VI into executable. If i want to know the the path to the executuble should I use Current VI's Path?
0 Kudos
Message 4 of 8
(3,518 Views)
If you use the Current VI Path, you have to be careful because it will return the path of the VI inside the executable...
Message 5 of 8
(3,509 Views)
When part of a build, it does not return what you expect.  You can experiment by displaying the path before & after you build.  The difference is that after you build, it will point to the exe that you created, because that's where it now is..

Read the info below in the attached image:

RayR


Have a look at this thread: http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=331832#M331832
Message 6 of 8
(3,506 Views)
Message 7 of 8
(3,469 Views)
You can use the Application.Kind property to determine whether you are in a development environment or run-time environment.  The property exists back to LabVIEW 5.0, when VI server was introduced.
0 Kudos
Message 8 of 8
(3,428 Views)