Click to See Complete Forum and Search --> : Dumb question regarding returning multiple values from a function


VirGin
March 9th, 1999, 10:32 AM
HiHiHi,


When I pass multiple values to a function, then return values to the calling function, sub or module, are all of the values that I passed to the function returned?


If not, what are some recommended methods of returning multiple values from a function.


thanx


V.

Vinayak Sapre
March 9th, 1999, 11:13 AM
Look for documentation of Byref & Byval. Byref with modify values (if changed in function) when function returns. Byval makes copy of variables passed so changes are not reflected in calling fuction

suyog
March 12th, 1999, 12:12 AM
maybe u can try the following. i am assuming you are using VB5.0


use the equivalent of the structure. i.e the Type data type in VB


in the .BAS module declare the Type...End Type block with its member variables

then declare a public method to set the variables,


and then access that public variable through your form file or wherever else.

since the Type declaration is global it can be used from everywhere..


the help on Type statement gives an example as well.


good luck


- suyog