Enumerations and Strings
It has been a while since my last post. Things get crazy at times. But, here is another bit of sample code for you to muse over. We will look at enumerations and strings. In C#, an enumeration is NOT a string, nor can you define it to be one. An enumeration can be defined as any of a number of integer types. You can leave it as its default type... public enum unspecifiedTypeEnum { one = 1, two, three, } In which case you get named 32 bit values. Or you can specify the type of the underlying value as byte , sbyte , ushort , short , uint , int , ulong or long ... public enum byteTypeEnum : byte { one = 1, two, three, } // or... public enum ushortTypeEnum : ushort { one = 1, two, three, } // etc... ... But, you can't declare it as a string. That doesn't mean you can't use strings at all. When I want to save data to a file for future reference, I like to make my enumerations human readable and store them...