06-25-2018 09:38 AM
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.
06-25-2018 09:49 AM
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.
06-25-2018 09:56 AM
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.
06-25-2018 10:04 AM
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.
06-25-2018 10:07 AM
Change the boolean action from "switch until released" to "latch when released"
06-25-2018 10:19 AM
Works great. Thanks for your help.
06-25-2018 10:19 AM
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.
06-25-2018 10:20 AM
This was in response to paul_cardinale.
First time on the forum.
06-25-2018 10:24 AM
@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.
06-25-2018 10:28 AM
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.