Get Enum value?

danyeungw

Well-known member
Joined
Aug 30, 2005
Messages
73
Programming Experience
10+
How do I get the value if the Enum has only one value each line. For example:

Public Enum BJResult
PlayerBust
DealerBust
PlayerWin
DealerWin
Push
end Enum

Thanks.
DanYeung
 
start with 0, and add 1 on each line..... so playerbust = 0, dealerbust = 1, playerwin = 1, etc.....

-tg
 
I'm not sure I understand what you're asking. Generally it doesn't matter what the numerical value for each constant is because you never use it directly. The default for all enumerations is for the first constant to be zero and every other to be one greater than the one before it. If it actually does matter what the numerical values are then, as TechGnome says, you can specify any or all of the values explicitly. Any values that you don't set will follow the rules I mentioned earlier.
 
Back
Top