Link to home
Start Free TrialLog in
Avatar of allanhutton
allanhutton

asked on

vb.net Function Parameter Comments

i've see people write library's that have suggested values when calling the function. i would like to do that same thing within my code but cant seem to find how to do it at all. the best i can do i defining optional parameters.

Public Function test(byval Optional Testername as String = "Jack") as String

so when i call the function i would get something on these characters

test( "intelisene would suggest Testername = Jack

but what i really want to do is to show all the valid values like

Public Function test(byval Optional Testername as Integer = 1 "1= Jack" or 2 "2=Tim" or 3 "3=Jill") as String

so when i type the call

test( "intelisense would suggest 1=jack, 2=Tim, 3=Jill so if i pass test(1) the user knows he is calling the string Jack.

I hope that makes sense, but it will make my coding more user friendly and easy to understand even if this question isn't.

Cheers
Allan


   
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of allanhutton
allanhutton

ASKER

let me give that a go looks interesting. I'll confirm soon if that what i'm trying.

cheers
Allan
the XML triple quotes was exactly what i was looking for thank.

   '''
    ''' Delete Order by specific Order Parameter
    ''' 0=All Orders
    ''' 1=Last Order
    ''' 2=Specific TTSitteOrderKey
    ''' 3=Delete range or Orders
    '''
    '''
    '''
    '''
    Function InvokeDeleteOrder(ByVal DeleteType As Integer) As Integer


can i just ask what you would use the returns and remarks xml values for?

cheers
Allan
<<<<<<<<
Grading Comments:
the XML triple quotes was exactly what i was looking for thank.

''' <summary>
''' Delete Order by specific Order Parameter
''' 0=All Orders
''' 1=Last Order
''' 2=Specific TTSitteOrderKey
''' 3=Delete range or Orders
''' </summary>
''' <param name="DeleteType"></param>
''' <returns></returns>

''' <remarks></remarks>
Function InvokeDeleteOrder(ByVal DeleteType As Integer) As Integer


can i just ask what you would use the returns and remarks xml values for?

cheers
Allan
>>>>>>>>

You can give more details on what your method returns.  So, I know it returns an Integer, but can put in a remark like "the number of orders deleted/affected" or whatever the Integer signifies.

The remarks allow you to add additional comments beyond the summary from my understanding.