Results 1 to 4 of 4

Thread: Vb Function

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2021
    Posts
    2

    Question Vb Function

    Hello Guys.,

    Hope all r doing great.

    I have a requirement of getting multiple return values from a vb function as Array format or just like multiple variables.

    Is there any possibility for that..??

    Regards
    Sudheer

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: Vb Function

    Sure... you can return an array, a structure, or a class. Take your pick.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2021
    Posts
    2

    Re: Vb Function

    Thank you Tg

    Can you post any example of that..

  4. #4
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: Vb Function

    Quote Originally Posted by nagasudheer. thota View Post
    Thank you Tg

    Can you post any example of that..
    Code:
    Function MyParamReflectionFunc(a, b, c)
      MyParamReflectionFunc = Array(a, b, c)
    End Function
    The multiple result-values of this little "Param-Reflection-Function" come in an Array:
    - e.g. when called like that: Dim ResultArr: ResultArr = MyParamReflectionFunc(1, "xyz", 123.456)
    - a then sitting behind ResultArr(0)
    - b behind ResultArr(1)
    - ... etc

    Olaf

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