10-24-2017 03:09 PM
Hi guys,
I'm about to give up on this, I've searched all day about this and no one have the same thing that I want...
I have a txt file that is like this
Red red.png
Yellow yellow.png
Blue blue.png
...
N-Color ncolor.png
Using this file I want to create a combobox that its items and values have:
Items | Value
Red | red.png
Yellow | yellow.png
...etc
Right now I'm using Read text from File and Spreadsheet String to array but I can't figure out how to achieve this.
Solved! Go to Solution.
10-24-2017 03:40 PM
Post a VI of what you have tried so far.
10-24-2017 03:56 PM
here it is, is not very useful really...
10-24-2017 05:08 PM - edited 10-24-2017 05:09 PM
You want to write to the Strings And Values property. I also recommend using the Read Lines option on the Read Text File and then a FOR loop to parse each line (Match Pattern with a tab as the desired pattern).
10-24-2017 06:58 PM
Thank you so much for the answer, I'll check it tomorrow in college and i'll answer, thanks again!
10-25-2017 08:43 AM
Hi Crossrulz, I'm making the VI that you send me and I have a little issue (I think)
Is with the array that goes to the bundle, here is the picture...
I create an Array Constant to the Index Array Input, can you please tell me what's wrong? thanks!
10-25-2017 09:04 AM - edited 10-25-2017 09:05 AM
Hi nox,
create this array constant directly from your combobox "strings&values" property node!
(This way it will be a typedefinition as shown in Crossrulz' snippet! Btw. you need an array of cluster as is written in the context help of this property node…)
10-25-2017 09:43 AM
By the way there is no need to recreate the VI. The image CrossRulz has the VI embedded in it as a snippet.
http://www.ni.com/tutorial/9330/en/
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-25-2017 09:48 AM
@lord_nox wrote:
I create an Array Constant to the Index Array Input, can you please tell me what's wrong? thanks!
Right-click on the StringsAndValues[] input and select Create->Constant. That will be the array of clusters you should be using.
As an aside, I always find Type Def of an array to be painful for a user. The contents of the array should be the Type Def (in this case, the String/Value pair cluster), making things a lot more modular and easier to use.
10-25-2017 12:27 PM
Thanks to everyone, is working! 🙂