Results 1 to 3 of 3

Thread: what is an enum?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Posts
    95
    what is an enum or an enumeration?

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest
    put this in a module
    Code:
    Enum YesNoHello
        Yess = 1
        Noo = 2
        Helloo = 3
    End Enum
    this is like the type, but this is read only..
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width