Keep an array of strings in which the indix value in this string array matches the enumeration value used.
So, if you have:
enum COLOUR {WHITE = 0, RED = 1, PURPLE = 2, BLUE = 3, GREEN = 4, YELLOW = 5, ORANGE = 6};
Then I would define an array:
String colors[] = {white, red, purple, blue, green, yellow, orange}
Then, when you have a function that returns an enumeration of this type, you can simply put it in your array and get the correct color in string format.
aaron burns
source share