Try:

dim myEnum as OneTwoThree
dim i as integer

myEnum = OneTwoThree.One
i = int32(myEnum)

Gary

On Apr 6, 2006, at 10:56 AM, GregO wrote:

On Apr 6, 2006, at 10:46 am, GregO wrote:


The release notes for 2006r1 say:

[All] [All] Language: Enum values must be cast explicitly to integer
            types; there is no longer an implicit conversion.

I have an enum in a module defined as:

enum OneTwoThree {
        One = 1
        Two = 2
        Three = 3
}

Then in my code I do this:

dim myEnum as OneTwoThree
myEnum = 1 '<------

I get an error that says: Type mismatch error. Expected OneTwoThree, bug got Int32.

My question is: I seem to be able to do this in VB, wouldn't it make sense to be able to do it in RB as well?

Also, why can't I do this:

dim myEnum as OneTwoThree
myEnum = One '<---------

GregO

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to