what is an enum or an enumeration?
Printable View
what is an enum or an enumeration?
It's a group of constants. If you have a lot of constants it may not be as organized and you want to have a shortcut to the right constants, you just need to enumerate a group of constants and declare a variable, property or whatever as that enumeration.
Code:Enum EnmSize
None=0
Small=1
Medium=2
Big=3
Huge=4
end enum
Dim yoursize as EnmSize
put this in a module
this is like the type, but this is read only..Code:Enum YesNoHello
Yess = 1
Noo = 2
Helloo = 3
End Enum
well you can write to it, but it has to be directly in the enum statement...
call it like this
Code:a = YesNoHello.Yess
MsgBox a