Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function Question

Status
Not open for further replies.

PsychoCoder

Programmer
May 31, 2006
140
US
Is it possible to return 2 values from a function? I know you can use

Code:
Return VariableName
But is it possible to do

Code:
Return Variable1,Variable2

Senior Qik III, ASP.Net, VB.Net ,SQL Programmer

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"In the new millennium there will be two kinds of business; those on the net and those out of business"

~ Bill Gates ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
return a contactenated variable and split it when you need the indiviual values...

-DNG
 
DotNetGnat,

Can that still be done if one of the return "variables" is a DataTable?

Senior Qik III, ASP.Net, VB.Net ,SQL Programmer

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"In the new millennium there will be two kinds of business; those on the net and those out of business"

~ Bill Gates ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
You could add the relevant objects to a Collection and return that Collection instead.

However, it seems like you are not using a Object Orientated approach. Instead, try exposing the relevant variables through a Property.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I pass by reference instead of by value when I need to return more than one value.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top