string value of enum

  • Thread starter Thread starter RP
  • Start date Start date
R

RP

Hi all, I was wondering if there was a way to return the string value of an
enumeration. Example:

Public Enum MyStatus
NA
YES
NO
End Enum

Dim a as MyStatus = MyStatus.YES
response.write(Cstr(a)) ' returns 0

Instead I need "YES"

TIA,
PR
 
I tried the reverse and it did not work:

Dim strvalue as string = "YES"
Dim b as MyStatus = CType(strvalue, MyStatus)

any ideas?
 
Back
Top