LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ListBox

hi , i want to use a listBox to display information from file ,so i use a control file path and ListBox , but there a problem , that when i enter as a file path a .txt or texte word , it sent an error.

0 Kudos
Message 1 of 3
(2,794 Views)

ListFolder.vi returns a list of all the folders and files within the folder you pass to it through the path input. If you connect a path to a specific file to it, it won't work, because you need to pass a path to a folder. If you want to read the list from the file you need to use the read from text file vi and parse the string in the file.



Remember Cunningham's Law
0 Kudos
Message 2 of 3
(2,787 Views)

First a bit of etiquette:

Please don't post files in a propriatary format.  Word documents are suceptable to contaning malicious things and you need MS office to see them.  Simply post a *.png created from the snipping tool.

 

Then, The error you are getting is because  you passed a file name into List Folder- This is normal. List Folder "Returns two arrays of strings listing the names of all files and folders found in path, filtering both arrays based upon pattern and filtering the filenames array based upon the specified datalog type" Look it up in the help file.  Instead select a folder. to use that function correctly.

 

However, it sounds like you want to read the contents of a file.  There are a few options depending on how the file data is structured and how the elements are delimited.  Can you post an example of the text file?


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 3
(2,781 Views)