LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I delete a name from a list of names by pressing "delete" button?

Solved!
Go to solution

Why is a delete button an indicator?  You can't press an indicator, thus it can't fire a value change event.

 

Buttons should be CONTROLS.

0 Kudos
Message 11 of 17
(680 Views)

I attached a VI. Just give it a try and you will see what I'm talking about. Try to delete every name one by one and you will see that the delete button is not working as it should. What am I doing wrong? I would appreciate it if you attach a VI. I'm more of a visual learner. Also, for your information, I'm new to LabView.VI.PNG

Download All
0 Kudos
Message 12 of 17
(750 Views)

Because you are using a tunnel that keeps the original value.  You should either use a property node to read the item names inside of the Event Structure or you could keep the current list in a shift register.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 13 of 17
(735 Views)
Solution
Accepted by topic author GRC5000

Here's what you should do instead. No need to read the file after writing. (In fact you have a race condition in your code, because there is no guarantee that the reading happens only after writing! You can use the newval event data node in the other event. No need for local variables)

CC1.png

Message 14 of 17
(715 Views)

Altenbach. Thank you very much. You are the man!!!! You saved my life. I wish I could give you more than just one kudo

0 Kudos
Message 15 of 17
(687 Views)

Altenbach. You made my VI look so bad. You used a few blocks and problem solved.

0 Kudos
Message 16 of 17
(681 Views)

Of course this was a only a very rough draft. You also need:

Deal with the possibility that the drive or file does not exist.

Decide what the value of the listbox should be after deletion. (Probably "no selection").

Implement code to add items,

... Etc.

0 Kudos
Message 17 of 17
(676 Views)