vb.net Function Parameter Comments
Posted on 2008-10-27
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.