G
Guest
Hello,
I have a class with a property called Quality. The property is defined as:
Public ReadOnly Property Quality() As Qualities
Qualities is defined as
Public Enum Qualities As System.UInt32
Qualities enumerated values are GOOD = 0 and BAD = 1
If I try to compile a VB.NET 2003 app with the following comparison:
If myClass.Quality = Qualities.GOOD Then
' do something
End If
I get the compiler error shown below:
error BC30452: Operator '=' is not defined for types 'Qualities' and
'Integer'.
The Help description is:
***
You have attempted to use a binary operator to perform an operation that is
not valid for the two value-returning code elements involved.
To correct this error check the two elements and make sure they are
compatible.
***
The equivalent code works in C#.NET
if (myClass.Quality == Qualities.GOOD) { }
Any suggestions?
I have a class with a property called Quality. The property is defined as:
Public ReadOnly Property Quality() As Qualities
Qualities is defined as
Public Enum Qualities As System.UInt32
Qualities enumerated values are GOOD = 0 and BAD = 1
If I try to compile a VB.NET 2003 app with the following comparison:
If myClass.Quality = Qualities.GOOD Then
' do something
End If
I get the compiler error shown below:
error BC30452: Operator '=' is not defined for types 'Qualities' and
'Integer'.
The Help description is:
***
You have attempted to use a binary operator to perform an operation that is
not valid for the two value-returning code elements involved.
To correct this error check the two elements and make sure they are
compatible.
***
The equivalent code works in C#.NET
if (myClass.Quality == Qualities.GOOD) { }
Any suggestions?