LHarris Posted March 22, 2010 Report Share Posted March 22, 2010 I've found another way round for what I was trying to do, but I am still curious as to whether things could work this way. I created an array where each row consisted of a cluster of two strings and a lower-level cluster. Each row was dynamically generated when the user wanted to add it. I wanted to pass the appropriate lower-level cluster as a reference to a subVi so it could be constantly updated, but couldn't see how to generate the reference for the cluster on the specific array row. Is this possible? Or would I have to pass a reference to the whole array, along with an index for the row I needed the subvi to interact with? Quote Link to comment
Ton Plomp Posted March 23, 2010 Report Share Posted March 23, 2010 You can't get a reference to a specific element in a front panel array. It might be better to not show the array 'as is' to the user. Having a table of multi column listbox together with a Functional global that holds the data and provides an edit functionality. Ton Quote Link to comment
LHarris Posted March 24, 2010 Author Report Share Posted March 24, 2010 Having a table of multi column listbox together with a Functional global that holds the data and provides an edit functionality. As a friend of mine used to say "I think I understand all the words in the sentence, but the overall meaning escapes me". Could you please explain in a bit more detail what you are suggesting? Quote Link to comment
Whooly Posted April 23, 2010 Report Share Posted April 23, 2010 Hi! I also tried multi column listbox but they haven't got extra functionailties. You can't easily add combobox, path and other columns. So an alternativ is to use array. But they are alse very limited. If u change a propertie of the control it changes everywhere. You can't change a color in one row. And can't use Xcontrol in arrays. I made a little discovery yesterday i can get a reference to the clicked arrayelement. So i can change the value easily. But i don't know why it works because i put a probe on the reference it points every time to the same. ClickedArrayElementRef.vi Quote Link to comment
Grampa_of_Oliva_n_Eden Posted April 23, 2010 Report Share Posted April 23, 2010 Hi! I also tried multi column listbox but they haven't got extra functionailties. You can't easily add combobox, path and other columns. So an alternativ is to use array. But they are alse very limited. If u change a propertie of the control it changes everywhere. You can't change a color in one row. And can't use Xcontrol in arrays. I made a little discovery yesterday i can get a reference to the clicked arrayelement. So i can change the value easily. But i don't know why it works because i put a probe on the reference it points every time to the same. I have only found one method that lets me get at a specific element in an array via control refs. It is very convoluted but I posted code and talked about in this Nugget on the Dark-side. http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=267659#M267659 At the very least a review of that Nugget will show you just how complicated it is to get at an array element. Ben Quote Link to comment
LHarris Posted April 23, 2010 Author Report Share Posted April 23, 2010 I made a little discovery yesterday i can get a reference to the clicked arrayelement. So i can change the value easily. But i don't know why it works because i put a probe on the reference it points every time to the same. The reference is the same every time because it is pointing to the same string element on the front panel, rather than a specific element of the array. Try this - have the array counter set on 0 so you can see your "a" "b" and "c". Click on C. Then change the array counter up to 2 (so "c" is in the top box). Click on the "write text" button and the text is still written in the 3rd box, rather than overwriting the "c" and becomes the 5th element (index 4) not the third. Ben - thanks, that's given me a couple of thoughts on things to try ..... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.