LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

show index of selected element - 2d array

hello everyone,

 

i have a 2-D array indicator, I need to display the row and column of the element that is selected with the cursor.

 

Any ideas?

 

thank you

 

Lorenzo

0 Kudos
Message 1 of 8
(4,378 Views)

Hi loba,

 

Yes, you can use a property node with Arrelement.Value proterty selected.

I made you a code.

 

Regards.

Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
0 Kudos
Message 2 of 8
(4,365 Views)

It's kind of ugly, but it's the only way I know to do it:

Index of Selected Element.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 8
(4,361 Views)

Here another way.

Spoiler
Capture.PNG
Sabri JATLAOUI - Certified LabVIEW Architect - Certified LabVIEW Developer
0 Kudos
Message 4 of 8
(4,354 Views)

thanks boyz. Got it!

0 Kudos
Message 5 of 8
(4,343 Views)

Your VI returns the value, the OP asked for the indices.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 8
(4,339 Views)

Depending what you are trying to do, you might consider using a table instead of the array indicator (if you are using strings, you can just pipe a 2D array straight to it).

 

Then on the mouse up event use a property node to look at the SelStart property - this gives the row and column that was clicked.

0 Kudos
Message 7 of 8
(4,329 Views)

If it is an indicator, may be it is better to use table, not 2D array? It has mouse click "Point to Row Column" method, relatively easy cell highlight

 

0 Kudos
Message 8 of 8
(4,321 Views)