Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Different way to do stats
#17
Dave Wrote:Is there a function to get how many items are in an enum?

Nope. Most languages do not have this without some form of reflection / metacoding.

Also, Enums are, in most languages (I believe), a collection of constants. The only difference between:

Code:
enum X
   a = 1
   b = 2
   c = 3
end enum

and

Code:
X_a = 1
X_b = 2
X_c = 3

is the forced relation between the elements in the enum and the intellisense. That way, if you specify an enum (instead of the underlying value of an enum which is usually the system's word size), you can show that only the given constants should be used for the input value.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)