Question on Returning arrays


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Question on Returning arrays

  1. #1
    basara Guest

    Question on Returning arrays


    I can't seem to find this in the documentation so I''l ask it here. Can arrays
    be returned from fucntions without placing them within Variants?

  2. #2
    Ilyan Mishiyev Guest

    Re: Question on Returning arrays


    Not the best solution, but you can use global variable as array

    >I can't seem to find this in the documentation so I''l ask it here. Can

    arrays
    >be returned from fucntions without placing them within Variants?



  3. #3
    Karl E. Peterson Guest

    Re: Question on Returning arrays

    Basara --

    > I can't seem to find this in the documentation so I''l ask it here. Can arrays
    > be returned from fucntions without placing them within Variants?


    Did you try? Hard to offer a newbie better advice than that!

    Anyway, plug this into VB6, and give it a whirl.

    Private Sub Form_Click()
    Dim a() As Long, i As Long
    a = test
    For i = LBound(a) To UBound(a)
    Debug.Print a(i)
    Next i
    End Sub

    Private Function test() As Long()
    Dim l(0 To 2) As Long
    l(0) = 1
    l(1) = 2
    l(2) = 3
    test = l
    End Function

    Later... Karl
    --
    http://www.mvps.org/vb




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center