Thomas Granito Posted December 15, 2023 Report Share Posted December 15, 2023 Hi, I'm trying to populate string and value of a combo box from a txt file (Lista motori) but i don't get any result. Someone can help me please? Where do i make mistakes? forum.vi Lista Motori.txt Quote Link to comment
crossrulz Posted December 15, 2023 Report Share Posted December 15, 2023 1. Use Read Delimited Spreadsheet File to read the file and get a 2D array of strings. 2. Your text file does not have any tab characters. Are they supposed to be space delimited? 3. You have duplicate values in your text file. This could be causing an error when you try to set them. Quote Link to comment
Thomas Granito Posted December 15, 2023 Author Report Share Posted December 15, 2023 1. Ok 2. Yes, the space delimited But i don't understand how can i modify this, can you show me the vi modified, please? Quote Link to comment
Thomas Granito Posted December 15, 2023 Author Report Share Posted December 15, 2023 3. The lista motori file has the first column that are the strings of my combobox and the second column that are the values. So, for examle Abc is the string and 123 is the value Quote Link to comment
Antoine Chalons Posted December 15, 2023 Report Share Posted December 15, 2023 (edited) Hi Thomas, In the ComboBox, you can't have string items that correspond to the same 'sting value' In you file, many Macchina have the same limit value (789), so the ComboBox property node returns an error. My suggestion is to build a map, when the user selects a string, you look in the map (look up table) the corresponding limit. see attached VI forum.vi Edited December 15, 2023 by Antoine Chalons Quote Link to comment
ooth Posted December 15, 2023 Report Share Posted December 15, 2023 I like the map option. If you still want a control that looks like the ComboBox maybe try a Multicolumn Listbox but hide the second column that contains the value. forum.vi Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.