A function must specify a return type.
If you don't know what "type" you will be returning you need to return an
"object" and then do a late binding to it to read the return value as
whatever you are doing with it.
I get a sneaking suspicion that you might be better off redesigning your
idea using a "Sub" and passing your parameters as referenced objects. You
will be able to set flags as well stating what the result of your Sub was.
The trouble is that a function can only have one return value. Of course
you can pass parameters by reference to it and change their values from
within the function as you see fit, but this would be confusing code.
Functions should return values and not change the value of parameters.
"Mark Kamoski" <mk******@yahoo.com> wrote in message
news:Ob**************@TK2MSFTNGP11.phx.gbl...
Hi Everyone.
Please help.
Is there a way to return void from a Function?
That is, what are the ramifications of writing something like the
following...
Private Function DoSomething()
''''''''''' code
Return Nothing
End Function
Is there any advantage to doing this?
What if there is no return type stated and the Return is left off
entirely? What happens then? Are there any implications?
(What I want to do here is to both explicitly state that there is no
return value and at the same time to use a Function rather than a Sub.)
Please advise.
Thank you.
--Mark.