Hello Zeekers,
What is the best way to represent indices of an array with the same value? Let’s say I declare a constant string array used for enumeration called ‘test’. Values 0 and 1 has some unique value, but anything from 2 and 7 has a constant value of ‘test2’. Is there a quicker way of representing this or would I need to manually set it?
const test = {
[0] = “test0”,
[1] = “test1”,
[2] = “test2”,
[3] = “test2”,
[4] = “test2”,
[5] = “test2”,
[6] = “test2”,
[7] = “test2”,
[8] = “test3”,
} &default=function(i: count):string { return fmt(“test(%x)”, i); } &redef;
Thanks,