Results 1 to 8 of 8

Thread: InteliSense enum?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091

    InteliSense enum?

    hi,

    How do I create an enum list of values to show up as a dropdown list in a function's parameter list?

    Visual Studio 2010

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    No idea if this will trigger the IntelliSense or not (I use VC++5) but I'd expect it to:
    Code:
    enum days {
        monday,
        tuesday,
        wednesday,
        thursday,
        friday,
        saturday,
        sunday
    };
    
    void myfunction(days d, int *i) {
        *i = d;
    }
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Zaei
    Guest
    It doesnt. Remember your values =P.

    Z.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Which values?

    You don't need to give them in C++ enums - they start from 0 and go up.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    Zaei
    Guest
    No, remember what values your enum can have =).

    Z.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    0 to 6 I would have expected...

    ...I don't totally understand what you mean.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    Zaei
    Guest
    Im saying "dont rely on intellisense". Keep the possible enum values in your head =). For example, using the days enum, just remember that the possible values are sunday, monday, tuesday, wednesday, thursday, friday, or saturday.

    Z.

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I do that anyway

    I've been doing that for the past 5 or 6 years, since the days of C, when I learnt on BBC
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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