03-14-2012 06:13 PM
Hi,
I need to select an exercise from a table (see attached). Goto the front panel and select a row with a mouse click then hover over an exercise. Can anyone suggest graceful way of exiting out of the event structure by hitting the enter key and passing the exercise you have selected to a string indicator??
Thanks!
Solved! Go to Solution.
03-14-2012 06:16 PM
I need to reduce or elliminate the jitter you see when selecting an exercise also. Thanks again,
03-15-2012 02:14 AM
@Newton2this wrote:
I need to select an exercise from a table (see attached).
Unfortunately, you are using a multicolumn listbox, not a table. In order to select individual cells, you need to use a table control.
Attached is a simple implementation, maybe it can give you some ideas. (I also assigned the enter key to the stop button).
03-15-2012 08:41 AM
Nicely done! I will need to convert the string array to an I32 however. I am trying to minimize the impact to the rest of the code I am modifying. Thank you for the help. John
03-15-2012 09:38 AM
With a tiny little math you can easily covert the cell coordinates directly to a unique I32. 😉
03-15-2012 10:20 AM
Actually, it is not the cell coords I am interested in. I see you are using an invoke node. I need to access the tables 'item names' but of course it doesn't have any! Only a property node does. The array that controls the rest of the program (the one I am modifying) uses I32. Any other ideas??
03-15-2012 10:25 AM
The item names for a table IS the table date. It is a 2D array of strings!
How does the table entry relate to the I32 number you are trying to get out?
03-15-2012 10:36 AM
That could be a problem! The string array as you say is a 2D of strings. The array I am after is a 1D array of I32 - this is the reason I created an idex value for each row element in my original program! If you change the value '8' to a '16' on the block diagram the exercise index will give you the correct index for each element in the table 0-32. This unfortunately will cause more jitter when you switch between columns 0 and 1. Any more ideas?
03-15-2012 10:47 AM
The original program, the one I am modifying was written with LabVIEW v. 6? My customer chose to use 1D arrays for his state machine unfortunately making any changes to it difficult.
03-15-2012 11:02 AM
Start out with a 1D array of strings and reshape it to a 2D array for the table. Once the item is selected, search the original table for the index or do some simple math.