The logic here is that an enumeration defines a type.
You already know about types because you use them everywhere. A class is a type. Thus, these are Integer , a Long , a String and all other built-in data types. And you can create custom user types using the Type keyword; eg.
' Defines a new type User Type User Name As String ID As Integer PhoneNumber As String End Type
If you think about it, you will see that it makes sense. You never use an enumeration directly. Rather, you use it as a type. You declare variables that contain the value of this type of enumeration, just as you would declare a variable that contains a value of type Integer or String .
In contrast, a constant is not a type. This is just a regular value, but not otherwise than if you declared a regular variable, except that the value of the constant variable cannot be changed.
Types can be defined anywhere, inside or outside the class. However, variables must be defined inside the class or inside the module.
source share