I never quite understood why Xojo enums could not be type equivalent to their underlying integer type and I get caught out by the compiler most every time I use them.
I’m getting a little bored of typing integer every time i want to pass an enum to the framework and was wondering, is there a more elegant way than a clumsy explicit cast?
ListBox2.HeaderAt(Integer(eColumns.columnName)) = ListBox1.HeaderAt(Integer(eFields.fieldName))
My first thought was to override the HeaderAt function. The following works fine for retrieving a value
MySubClassedListBox.HeaderAt(index as eColumns) Return HeaderAt(Integer(index)) End Function
Where I’m stuck is coming up with a matching assignment method. Is there a way to assign to HeaderAt using an enum as the index without breaking the assignment syntax?
It may be I’m being dumb here and missing something obvious. (I spend too much time using other development dialects these days.)