@Bri_G I know this, anyone who’s looked at the default Codea demos knows this. I’ve made tons of such things myself. There is absolutely no need to post code showing how to do this.
However if you look at the many many many places this is used for purposes that require conveying information beyond a sequence of numbers to a user (like for instance selecting between things with obvious names, like demos or levels or interaction modes or lighting effects or camera viewer types or model sets or types of butterfly or geographical regions or world-generation types or, or, or, or…) they all have to take various workarounds to display that information.
Some print it directly on screen, as with the physics simulator.
Some put explanations in the output window.
Some make a different parameter use the slider index to display the information in the parameter pane itself.
Many put no explanation at all and let you fiddle with it to figure it out.
Each coder has to figure out on their own how to get what is often essentially a very simple string’s worth of information to the user.
So I could not disagree more strongly that this is re-inventing the wheel. What is reinventing the wheel is forcing every coder who faces this issue to come up with their own way to get a simple piece of information to the user.
From a coding perspective it’s a negligible amount of extra work to turn a number into a string. From a UI perspective there is a world of difference between showing a number that means nothing to the user versus showing a string that is helpful to the user.
which doesn’t even touch on the fact that strings are the single most common non-numerical keys used in tables, so forcing programmers to take the extra step of turning an index into a key into a value is not a huge deal once, but forcing them to do it again and again and again and again, when they could simply use the slider to display and choose between those keys… well there could not be more apt an example of reinventing the wheel than that.
This would be extraordinarily useful, and over time save almost every Codea user a significant amount of extraneous grunt work.
Which is what a good UI should do.