Results 1 to 8 of 8

Thread: converting multidimensional arrays

Threaded View

  1. #1

    Thread Starter
    Lively Member Liquid Pennies's Avatar
    Join Date
    Jun 2002
    Location
    Charlotte, NC
    Posts
    124

    converting multidimensional arrays

    ok, now that i have my question about defining multidimensional arrays, how do i convert them. i really just want to know how to convert a 3d array into 2d, as well as a 2d array into a 1d. (im not going to bother converting 3d to 1d, b/c that would be too long of an array when i would rather deal with it in 2d)

    example

    2d to 1d
    VB Code:
    1. dim MyArray(2,2)
    2. dim MyOneDArray(8)
    3. MyOneDArray(0) = MyArray(0,0)
    4. MyOneDArray(1) = MyArray(1,0)
    5. MyOneDArray(2) = MyArray(2,0)
    6. MyOneDArray(3) = MyArray(0,1)
    7. MyOneDArray(4) = MyArray(1,1)
    8. MyOneDArray(5) = MyArray(2,1)
    9. MyOneDArray(6) = MyArray(0,2)
    10. MyOneDArray(7) = MyArray(1,2)
    11. MyOneDArray(8) = MyArray(2,2)

    but, ya know, i want to work with a much larger array conversion, and id dont want to have to type all that out...
    Last edited by Liquid Pennies; Jul 14th, 2002 at 07:50 PM.

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