Hi all
I have a user-defined class question. In my class I use an enumerated list for product type. I can read and write this value to an instance of the class.
What I need to do now is read the string value for the instance from the enumerated list.
Here's what I have so far.
The ProdDesc property should, for example, retun a value of "Desktop" when privProdType = 1.
I'm hoping I can do this without using a SELECT CASE syntax. (The Product list is much longer in real life.
VB Code:
Dim privProdType As Product Public Enum Product Desktop = 1 Notebook = 2 Server = 3 Printer = 4 'etc, etc End Enum Public Property Let ProdType(newType As Product) privProdType = newType End Property Public Property Get ProdType() As Product ProdType = privProdType End Property Public Property Get ProdDesc() As String 'some code to get the desc from the Enum list - based on privProdType End Property


Reply With Quote

