How to create, and read, an array indexed by "enums"

As I wrote, I have solved the matter and the sketch is running using a more structured construction. Sometimes "djungle methods" are used when no other solution can be found but they often cause a lot of trouble.