array question

  • Thread starter Thread starter WStoreyII
  • Start date Start date
W

WStoreyII

quick question

i know that a two dimension array is like a chart
basically (x columns, y rows)

my question is though what would an array with more than two dimensions look
like?

would it represent more than one table?

WStoreyII

Thanks Again

Happy Easter !!!!!
 
MyArray(x, y, z, ...etc)

After 3 dimensions, which you can picture as something like a rubic's cube,
it's best to stop visualizing the array, and just work with the fact that
you have more indexe combinations.

-Rob Teixeira [MVP]
 
ok i am sure you are right there
but like how would i use it

i cant use an array if i dont understand what each index does

WStoreyII
 
Hi WS

Your multidimensional Array is everytime an single Array from the lowest
level

I hope this helps?

Cor
 
ok i am sure you are right there
but like how would i use it

i cant use an array if i dont understand what each index does

WStoreyII

Try thinking of a two dimensional array as an array of arrays
Try thinking of a three dimensional array as an array of 2 dimensional
arrays.

Or if you prefer, try thinking in terms of 3D space X, Y, and Z axes where
the X dimension is horizontal from left to right, Y axis is vertical up,
and down, and the Z axis if forward and backwards.

Does that help any?
 
Better

Your multidimensional Array is everytime a single Array from the lower level

v(w,x,y,z)
-------------------
v(ArrayW)
w(ArrayX)
x(ArrayY)
y(ArrayZ)

Cor
 
ok i am sure you are right there
but like how would i use it

i cant use an array if i dont understand what each index does

YOU define what each index does.

For example :

Dim data(4, 11, 30, 11, 59, 59) as Long

Index per apperance : Year index (from 2000), month, day, hour, minute,
second

This array would have one Long in memory for each second elapsed from 2000
to 2005 (plus a couple extras since months dont always have 31 days, hour
change, etc). Don't actually try to allocate it for testing purposes, it
would take over 300 megs of memory...

Once you've passed 3 dimensions, you can't really picture it like other
arrays. In fact, in memory it's just a 1 dimension flat chunk of data
anyhow... hehe...

In fact you could switch dimensions and as long as you switch indexing
you'll always end up on the right element. In my example, it doesnt matter
if minutes are first or last, you'll get one slot of indexable memory for
each element anyhow. Your data would be reprensented differently in memory
though...

Alex.
 
Hi Sin,

This is a great answer, however start next time with telling "Think on the
dates and times".

However the answer is great and I will try to remember it me when someone
ask it again.

Cor
 
Back
Top