P
Perecli Manole
I need to store an enum datatype in a variable and then reference it members
from the variable. I have tried this but it does not work.
Private Enum enuTest1 As Byte
Opt1 = 0
Opt2 = 1
Opt3 = 2
End Enum
Private Enum enuTest2 As Byte
Opt1 = 5
Opt2 = 6
Opt3 = 7
End Enum
Private Sub Test()
Dim a As Type = GetType(enuTest1)
Dim b As Byte = a.Opt2
End Sub
I need b to get the value of 1 since Opt2 in enuTest1 is 1.
However if I put GetType(enuTest2) in a then b should be 6
Thanks
Perry
from the variable. I have tried this but it does not work.
Private Enum enuTest1 As Byte
Opt1 = 0
Opt2 = 1
Opt3 = 2
End Enum
Private Enum enuTest2 As Byte
Opt1 = 5
Opt2 = 6
Opt3 = 7
End Enum
Private Sub Test()
Dim a As Type = GetType(enuTest1)
Dim b As Byte = a.Opt2
End Sub
I need b to get the value of 1 since Opt2 in enuTest1 is 1.
However if I put GetType(enuTest2) in a then b should be 6
Thanks
Perry