LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

can I ssave a list created with the Toolsbox library

I created a list with the List utility comming with the programers toolbox, but I want to know how I can save it to disc for load after.
And also how i can load it (waht ist the procedure i have to do for perform it?
0 Kudos
Message 1 of 4
(3,250 Views)
File I/O isn't built in to the list structure. I would just write a utility routine to loop through the list and write each element to the file and another routine to loop through and read the list elements in.

Best Regards,

Chris Matthews
National Instruments
Message 2 of 4
(3,250 Views)
Hi there,

The easiest way to output a list ot a file, is with the function "OutputList" from the toolbox. Then when you want to read the list from file, you can retrieve one or all items from the file (say with fscanf or ArrayToFile) and insert them back into a pre-existing list.
I am attaching a simple C file that shows how to send your list to a text file.

Happy Thanksgiving!

Azucena
Message 3 of 4
(3,250 Views)
I actually attached an incomplete C file. Here is the code that will send a list created with the Toolsbox library to a file and then retrieve the list from the file programmatically.

Hope it works for you,

Azucena
0 Kudos
Message 4 of 4
(3,250 Views)