Results 1 to 3 of 3

Thread: Generalised Array Function [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Question Generalised Array Function [RESOLVED]

    Here's a poser.
    How could you make a function to display all the elements in an array?
    It is easy for a 1 dimensional array.
    e.g.
    VB Code:
    1. Dim intTest(5) As Integer
    2. Dim i As Integer
    3.  
    4. 'Set the values for this example
    5. For i = 1 To UBound(intTest)
    6.     intTest(i) = i
    7. Next
    8.  
    9.  
    10. For i = 1 To UBound(intTest)
    11.     MsgBox intTest(i)
    12. Next
    But how could you make a function that would return all the elements of a multi-dimensional array?
    The function would have to work for any (random) number of dimensions in the array.

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