ARC
Well-known member
I've looked around, and im still having a little trouble wrapping my head around the use of Enums.
Enums give a textual name to a variable? or does it have to be a constant?
And then what's actually being recovered? the text you labeled the variable with? or the actual integer of the variable? Or are they all automatically number 0 through x where x is the amount of textual representations in the Enum?
Suppose I wanted to grab a random textual representation of a variable inside the Enum below:
Thanks for the help!
Enums give a textual name to a variable? or does it have to be a constant?
And then what's actually being recovered? the text you labeled the variable with? or the actual integer of the variable? Or are they all automatically number 0 through x where x is the amount of textual representations in the Enum?
Suppose I wanted to grab a random textual representation of a variable inside the Enum below:
VB.NET:
Enum Mood
Angry
Happy
Sad
Confused
End Enum
Private sub Form1_Load...
Dim r As New Random
'obviously this is wrong... but you can see what im asking to do.
me.label1.text = "You sure are in a " + Me.Mood((r.next(1,4))) + "mood..."
End Sub
Thanks for the help!