02-25-2009 12:39 PM
02-25-2009 01:10 PM
02-25-2009 01:11 PM
You can simply add new entries by selecting the last button, holding the control (ctrl) button on the keyboard and using the mouse to drag the radio button, thus duplicating it. That is how I created the 20 radio buttons in the attached example.
What do you mean by assigning numeric values to each entry?
R
02-25-2009 01:25 PM
02-25-2009 01:49 PM
How about if they had the values 0,1,2,3,4,5... because they do. You'd need to either use these values or calculate a value based on them.
02-25-2009 01:51 PM - edited 02-25-2009 01:56 PM
Are you referring to this radio button?
Because the output of the radio button control is a numeric which gives the value of which button is selected, starting at 0.
In the above image, the value would be 1 because it is the second one selected.. If it was the last one in the 20 radio button example of my first post, then the value would be 19.
Unless you have the radio button by itself which is a boolean, but that gives you a 1 or 0.
So I still don't understand what you are trying to do. Can you explain why you want the value to be a specific number? Are you referring to the label (instead of "Radio Selection 1" )?
R
02-25-2009 01:53 PM - edited 02-25-2009 01:55 PM
Hi ray,
I think he is trying to use the radio button to select one of 20 different values. An example would be if you want to return "0" for the first button, "1" for the second, 4, 8, 16 ,32...
The radio button is a type of enum. Sparse Enums (enums with arbitrary values) can be used but not developed in LV.
A simple look-up table can be used to translate the enum to the numerics you desire.
Ben
02-25-2009 01:57 PM
Hi Ben,
Ah... okay... in that case a lookup table or simply wire the value into the proper equation to translate it to the desired value, ie: 2 ^ val
R
02-25-2009 02:04 PM
Ray.R wrote:Hi Ben,
Ah... okay... in that case a lookup table or simply wire the value into the proper equation to translate it to the desired value, ie: 2 ^ val
R
Sure that would handle my simple example.
That type of construct is handy if you are talking to a widget that has commands that are different numeric values. The radio buttons mutually exclusive behaviour force only one selection so when coupled with a look-up table the proper command code can be selected.
YOU take care of yourself,
Ben
02-25-2009 02:08 PM - edited 02-25-2009 02:10 PM
Have a look at the attached example. It shows a few approaches that you could use.
For a "look up table" I simply used an array. Put your values into the appropriate element. The example does have an array of 20 elements.
RayR
PS: Ben, was your last statement for me?