Results 1 to 2 of 2

Thread: How to declare multi dimensional array

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Location
    india
    Posts
    88

    Unhappy How to declare multi dimensional array

    can any one tip me on How to declare and manipulate data with multi dimensional arrays.

    store variables in to an array ( say arr1(5,5,5) ),
    and how to assign array data to variables.

    thanx in advance

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: How to declare multi dimensional array

    Quote Originally Posted by santosh66
    can any one tip me on How to declare and manipulate data with multi dimensional arrays.

    store variables in to an array ( say arr1(5,5,5) ),
    and how to assign array data to variables.

    thanx in advance
    VB Code:
    1. dim myarray(4,4,4) as integer  ' 0-4 = 5  (5^3 = 125)
    2. dim x%, y%, z%
    3. for x=0 to 4
    4.   for y=0 to 4
    5.     for z=0 to 4
    6.       myarray(x,y,z) = x * y * z
    7.     next z
    8.   next y
    9. next x
    10.  
    11.  
    12. x = myarray(2,1,3)
    13. msgbox x

    It doesn't do much, but it does what you asked.

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