New to LabView and am using 2017 version. I have a combobox that is already populated with items and a user will be able to add to the combobox items by entering a new string value and pressing a button. The button is in an event structure which is inside a while loop. The problem is when the new string value is updated in the combobox there are two. Is there anything that can be done to prevent the duplicate?
Thanks
Solved! Go to Solution.
Before adding the new value, use Search 1D Array to see if the new value is in the Strings[] array first. If it is not, then you can add the new value.
Thank you for the reply and the tip. I will add the Search 1D Array to prevent any duplicate values.
The problem I am having is when the pusbutton is pressed to add the new string it adds two of the new string instead of only one. I'm not sure if it's a timing issue or if the array will need to be evaluated after the new string is added to delete any duplicates.
You're using references unnecessarily. Use property nodes that are linked to the control.
Also, the terminal for the stop button needs to be in it's own Value Change event.
Change the boolean action from "switch until released" to "latch when released"
Works great. Thanks for your help.
It can also be done without the button. Combo boxes allow undefined values at runtime. Setup a Value Change on the combo box, check for duplicates and add the new value to the Strings array.
This was in response to paul_cardinale.
First time on the forum.
@kadilakd73 wrote:
This was in response to paul_cardinale.
First time on the forum.
Use the quote button to make reference to a specific message.
Thanks.
@aputman wrote:
@kadilakd73 wrote:
This was in response to paul_cardinale.
First time on the forum.
Use the quote button to make reference to a specific message.