11-01-2017 02:07 PM - edited 11-01-2017 02:10 PM
Programming a table in CVI, have done it before but not much.
Ok, so each item in a normal Ring control has Label | Value | Index associations.
When using a Ring embedded in a cell in a Table however, I only see a Value. You can apparently programatically access the index based on that value. Shouldn't there be the same Label | Value | Index for a Ring inside the table? All you can apply is a Value (which can be a string, huh?). I don't see the reasoning here. It looks like you have to get the index from the "value" and then programatically associate that index with a numeric. Wow how convoluted can you get.
What I want is a ring that has labels of none | 3rd | 6th | 12th that has values of 0, 3, 6, 12 when selecting index 0, 1, 2, 3 respectively.
It appears I have to allow the user to select an item from the ring list (the 'value in the setup' dialog box), then get the index from that ring item 'value', then assign a true numeric value based on the index to a variable. Is this correct or am I missing something here?
Solved! Go to Solution.
11-02-2017 04:57 AM
You are right: rings in table cells miss one element. They only have a value (which actually is a string as you have guessed) and an index. There is no numeric value associated to them. (I personally prefer to consider they actually miss the value and treat them either using the index or using the lable).
Given that using the string values is cumbersome, I normally operate on indexes: if the list of values is built programmatically this is quite sure as using numeric values, you'll only have to be sure new values are added at the end of the list so that old stored parameters are not affected.
11-02-2017 08:16 AM
Thanks once again Robert. I'm sure there's a good reason for it, but it's a crazy limitation.
C'mon CVI team, a little consistency here please.