Sorry for not responding dude, but really now.... There are examples on how to create/call functions in VB everywhere. Just download just about any sample VB code and you will see a sample of how to write and consume a function. I did not answer this question because I felt that it was asked by someone that clearly needed to do some looking around themselves on the subject. Sorry... Looking at the responses that you did get and what you found on your own you got the concept. Just please remember that no one here OWES anyone an answer. Just as a personal note… I hate function that have byref arguments. They are used alot in the Windows world and I still hate them. IMHO functions take in arguments and return a value. That is the pure way of thinking about it. When you use a function you always think of it as:
returnValue = FunctionName(arg1, arg2, … argn)
And the function looks as follows:
<scope> Function FunctionName(arg1 As Type, arg2 As Type, … argn As Type) As ReturnType
'define the return value to use
Dim retVal as ReturnType
'perform what ever calculations you need to do
'set the return value
retVal = answerToCalculation
Return ReturnType 'if you are using VB.NET
FunctionName = answerToCalulation 'if you are using VB6
End Function
The number of input args are up to what you need, and it is very clear as to what is being returned and where. Using ByRef is called output arguments. I don't like them at all. X| As I see it, if the returned values does not end up on the left side of a function call then it is not a function, it is a Subroutine.
Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things."