LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to select last used element in Multicolumn Listbox and delete its contents?

Hi, I have a MCLB where users enter data into a field and that data is uploaded to the topmost element in the MCLB. Then the next time they enter in data it is uploaded to the next element down and so on. I have a need to programmatically erase a few of the last elements of the Listbox once the user is done for the day. How can I access the last element, and at least five other elements above it, to have them all deleted?

0 Kudos
Message 1 of 9
(1,935 Views)

The data that goes into the listbox would be stored in an array that you maintain in a shift register between loop iteration.

 

So if you want to delete elements, then you need to use Delete from Array.

 

I you need more specific help, then you need to attach your VI so we can see how you are handling things now.

0 Kudos
Message 2 of 9
(1,930 Views)

@ShogunOrta wrote:

I have a need to programmatically erase a few of the last elements of the Listbox once the user is done for the day. How can I access the last element, and at least five other elements above it, to have them all deleted?



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 3 of 9
(1,911 Views)

Okay, I've attached my code as requested. Although, be advised this is a very partial code and will not run on compile. (There were a lot of loose ends I refrained from unsewing from the main program)

 

Anyway, to point you to the part I am referring to, in the Event Structure go to the tab labeled "Load Log Button 2". What this does is reads from a file, then writes to that file once the user presses the "Button 2". At the end, to the right, is where I was trying to implement my erasure of the last lines of user inputed data in the MCLB.

 

Sorry if this is too sketchy. I'll attach a tighter version if need be.

0 Kudos
Message 4 of 9
(1,903 Views)

Clean up the block diagram, it is huge with lots of white space.

Clean up the front panel, it is huge with lots of grey space.

Both take up dozens of screens of space.

 

I could not find your MLCB on the front panel.  It might be there, but the panel was so large, I couldn't find it.

 

I see added the code like CrossRulze showed.  But you used a property node for ItemNames that is not linked to any specific control.  That means you would need to wire a reference to a specific control into the upper left of those property nodes.  That, or if your control is on that front panel, right click the property node and hit "Link to" and pick your multicolumn list box out of the long list of controls that exist on your front panel.

0 Kudos
Message 5 of 9
(1,895 Views)

NA

0 Kudos
Message 6 of 9
(1,864 Views)

Thanks for responding, but myself being a rookie Labview developer....

 

How do you create that I32 bit integer for the multicolumn listbox? I found how to create the 6-Constant with the Delete Array Function, and I've found how to create a local variable for the MCLB, but not that specific integer icon. Is it a part of the 6 Constant? Sorry if this is a very nube question.

0 Kudos
Message 7 of 9
(1,852 Views)

Who are you talking to?  If you responding to a message that goes back a way, use the Quote function in the editor to quote the original message.

 

What specific integer icon are you talking about?

 

I would recommend you learn more about LabVIEW from here. How to Learn LV

0 Kudos
Message 8 of 9
(1,839 Views)

@ShogunOrta wrote:

How do you create that I32 bit integer for the multicolumn listbox?


It is the terminal for the listbox.  I just put the listbox on the front panel and then there is magically a terminal for it on the block diagram.


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 9 of 9
(1,834 Views)