J
Joe HM
Hello -
I have two Enums for which I would like to define type conversions ...
Public Enum eA
A2 = 0
A2 = 1
End Enum
Public Enum eB
B1 = 2
B2 = 3
B3 = 4
End Enum
Is there a way to define a conversion that maps one Enum to the other
because I would like to do the following ...
Dim AA as eA
Dim BB as eB
....
AA = BB
It does not have to be implicit ... so is there a way to overload
CType()? The following will complie but not work properly since the
Integer representations are different ...
AA = CType(BB, eA)
Is there a way to overload CType for this? I used to do things like
this in C++ where I would overload a conversion operator to get the
implicit conversion.
Any way to do this in VB?
Thanks!
Joe
I have two Enums for which I would like to define type conversions ...
Public Enum eA
A2 = 0
A2 = 1
End Enum
Public Enum eB
B1 = 2
B2 = 3
B3 = 4
End Enum
Is there a way to define a conversion that maps one Enum to the other
because I would like to do the following ...
Dim AA as eA
Dim BB as eB
....
AA = BB
It does not have to be implicit ... so is there a way to overload
CType()? The following will complie but not work properly since the
Integer representations are different ...
AA = CType(BB, eA)
Is there a way to overload CType for this? I used to do things like
this in C++ where I would overload a conversion operator to get the
implicit conversion.
Any way to do this in VB?
Thanks!
Joe