jtseltmann
Programmer
Well second question in as many days...but I had to. I have googled and read all morning and can't find a good answer that works in VB6.
I have some basic Enums that I'm trying to return the String value associated with them. I cannot seem to get anything to work. I am trying to NOT have to use a big Case statement to translate them but I have no options left.
Here is a simple snippet...
'---
Public Enum RS_FIELDNAMES
KeyField
Field1
Field2
End num
Public Enum RS_SORT
Asc
Dsc
End Enum
Public Sub RS_Sort(strField as RS_FIELDNAMES, strSort as RS_SORT)
Dim strSortString as string
strSortString = strSort.ToString()
Exit Sub
End Sub
'---
I can't get the strSortString var to show the "Asc" instead of 0. What could I be doing wrong? I have read a bunch of pages where it was outlined to just ust the .ToString function but I keep getting an error?
Thanks to anyone with some help.
I have some basic Enums that I'm trying to return the String value associated with them. I cannot seem to get anything to work. I am trying to NOT have to use a big Case statement to translate them but I have no options left.
Here is a simple snippet...
'---
Public Enum RS_FIELDNAMES
KeyField
Field1
Field2
End num
Public Enum RS_SORT
Asc
Dsc
End Enum
Public Sub RS_Sort(strField as RS_FIELDNAMES, strSort as RS_SORT)
Dim strSortString as string
strSortString = strSort.ToString()
Exit Sub
End Sub
'---
I can't get the strSortString var to show the "Asc" instead of 0. What could I be doing wrong? I have read a bunch of pages where it was outlined to just ust the .ToString function but I keep getting an error?
Thanks to anyone with some help.