Enums. What are they and Why use them

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

I keep seeing Enums in various bit of code and I've read some material on
them. But I'm no wiser, has anyone got a muppets guide to Enums?

TIA
john
 
An Enum is simply a list of valid values for specific cases. You declare an
Enum with specific named values in it, and then you can refer to those named
values as constants. If you declare a variable as being of the Enum, then
intellisense will present you with the list of defined values for that
enumeration.

See http://msdn.microsoft.com/library/en-us/vbenlr98/html/vastmEnum.asp and
http://msdn.microsoft.com/library/en-us/vbenlr98/html/vastmenumx.asp in
MSDN, or check out http://en.wikipedia.org/wiki/Enumerated_type
 
Thanx Guys for the response.

Ok the mist is lifting...slowly. I need to play around with this further.
 
I keep seeing Enums in various bit of code and I've read some
material on them. But I'm no wiser, has anyone got a muppets guide
to Enums?

When you use Intellisense in VBA or the Immediate Window, you're
seeing enums whenever there's a list of values to choose from.

It's to help the programmer write better code. It doesn't actually
make the code more bullet-proof itself.
 
Back
Top