CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2002
    Posts
    14

    Lightbulb how describe possible values for parameter for a sub

    Hello All,

    I am actually doing a library of subs and functions that will be use by collegues in the office.

    I would like to describe, when usefull, the list of possible values available for parameters of theses subs and functions. So when people use this sub or function, he can select one of the value in the list.

    Any help will be appreciated.

    Chris

  2. #2
    Join Date
    Dec 2001
    Posts
    6,332
    I think what you want is an Enum.

    Code:
    Public Enum Answers
    Answer_No
    Answer_Yes
    Answer_Maybe
    End Enum
    Then in your Sub or Function:
    Code:
    Public Sub MyAnswer(TheAnswer As Answers)
    'your code
    End Sub
    This also works for Properties.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

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

Featured