# How do I get the Z width of a specific xy Array position?

Get help using Construct 2

### » Mon Mar 21, 2016 12:06 am

Hello,

i have a 3 dimensional array like this:
Code: Select all
`{"c2array":true,"size":[3,3,3],"data":[   [      ["Students"],      ["Simon"],      ["Sarah"]   ],[      ["Proben"],      ["Brüche zu Dezimalbrüchen 1","Mathe","Dezimalbrüche"],      ["Geometrische Flächen","Mathe","Geometrie"]   ],[      ["Themen"],      ["Dezimalbrüche","Mathe"],      ["Geometrie","Mathe"]   ]]}`

How can i get the "depth" of i.e. "Geometrische Flächen"
or
how can i get the "height" of i.e. "Students" ?

Is there a possibility to do sth. like this: myArray.At(0).lengthor myArray.At(1,1).length.

Thank you
B
7
Posts: 5
Reputation: 291

### » Mon Mar 21, 2016 4:41 pm

The z depth of any given x/y will always be the same as the total depth of the array, even if there is no data in the cells. An empty cell will contain 0 though, so you can make a function loop to check how many cells in that particular row/column are not equal to zero and return the result.
B
60
S
30
G
134
Posts: 1,949
Reputation: 75,375

### » Mon Mar 21, 2016 5:06 pm

May i suggest the 3D Dictionary plugin by Kevin Khantzis ? It is heaven to work with.

forum/plugin-storage-3d-dictionary_t125861
B
33
S
18
G
29
Posts: 2,493
Reputation: 21,450