Is there a way in vb6, as there is in .NET, to get the actual name of an enumeration constant ?
ie:
enum test
one=0
two
end enum
return "one" instead of 0
Printable View
Is there a way in vb6, as there is in .NET, to get the actual name of an enumeration constant ?
ie:
enum test
one=0
two
end enum
return "one" instead of 0
No, but you could do this.
vb Code:
Option Explicit Private Enum test one = 0 two End Enum Private EnumNames(1) As String Private Sub Form_Load() EnumNames(0) = "one" EnumNames(1) = "two" MsgBox EnumNames(one) ' ==> one End Sub
That'll work - thanks marty!
You're welcome. BTW the best way to show that the thread is resolved is by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button.