CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 1999
    Posts
    1

    Dumb question regarding returning multiple values from a function



    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.



  2. #2
    Join Date
    May 1999
    Posts
    45

    Re: Dumb question regarding returning multiple values from a function



    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

  3. #3
    Join Date
    Mar 1999
    Posts
    2

    Re: Dumb question regarding returning multiple values from a function





    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




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured