|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Get enum-values with variable?
I have bit of a problem with enum.
The base story is that the enum membernames is not allowed to contain invalid characters as in my case "-". Instead i have done a wrapper that replaces the "-" with "_" wich ought to work in my case. But when the translation is done i want to read the the translated line from a enum... Heres th code: PHP Code:
Thanks !! |
|
#2
|
|||
|
|||
|
Using
PHP Code:
Only gives back Error 1 'strBeenConv' is not a member of 'DOLA.DOLA.enNTF_CHK'. C:\DOLABase.vb 352 21 DOLA |
|
#3
|
|||
|
|||
|
Did like this instead...
Code:
Protected Overridable Function ReadFloatPre(ByVal CHECK As String, Optional ByVal enflags As enRFlags = 0) Dim fval As Double Dim strToConv As String = CHECK Dim i As Integer = 1 Dim nmbNTF As Int32 Dim arNTF As Array Dim strBeenConv As String = Replace(strToConv, "-", "_") 'The replacement of characters arNTF = [Enum].GetNames(GetType(DOLA.enNTF_CHK))[Enum].GetNames(GetType(DOLA.enNTF_CHK)) For Each cnvNTF As String In arNTF i = i + 1 If (cnvNTF = strBeenConv) Then nmbNTF = i End If Next 'Do the stuff we want Return fval End Function |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Get enum-values with variable? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|