Thursday, February 5, 2009

Cannot have an enum of strings

When you try to do the following

Public Enum Enum_Type as String
  VALUE1 = "Value1"
  VALUE2 = "Value2"
End Enum

I get some error that the enum must be of integral type.

My work around was to do the following (nothing elaborate here):
Public CONST VALUE1 = "Value1"
Public CONST VALUE2 = "Value2"

And then I just accessed the values the same way I would have from the enum

-- Ted

No comments: