Hello,
I am currently coding a multi-button switch. Each entry is constituted by a character chain (what is displayed on the button) followed by a number (the value sent by the button upon selection). However it is really difficult because the switch's values field doesn't accept that several entries share the same chain even if they have different values. So far the solution has been to insert spaces before and after chains to make them different from others. The problem is I sometimes need 10 buttons with the same display and it's hard to count the spaces in existing chains in order not to repeat the exact same pattern.
Therefore I am wondering whether there is a way to code the entries without any automatic re-ordering. In some thread about a matrix, the recommended solution was to put the values in an array and use the position in the array to retrieve each value:
var indices = [12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3],
index = indices[$]
Is it possible to achieve something similar when entries have a structure string:number and with some repetitions? I only need the strings to be arbitrary whereas the number sent should only match the button's position in the switch.
var strings = ["a", "b", "1", "a", "b", "G", ...]
How could I code this?