Enumerations are a handy programming construct that allow you to group name/value pairs. For example, assume you are creating a video game application that allows the player to select one of the three character categories(Wizard, Fight , or Thief). Rather than keeping track of simple numerical values to represent each possibility, you could build a custom enumeration using the Enum keyword.
' A VB enumeration type.
Enum CharacterType
Wizard = 100
Fighter = 200
Thief = 300
End Enum
' A VB enumeration type.
Enum CharacterType
Wizard = 100
Fighter = 200
Thief = 300
End Enum
Comments
Post a Comment