## Recommended Posts

Need help to understand how Arrays work.

```;First Example

Dim \$aArray[2][2][2]

\$aArray[0][0][0] = 1
\$aArray[0][0][1] = 2
\$aArray[0][1][0] = 3
\$aArray[0][1][1]  = 4

\$aArray[1][0][0] = 5
\$aArray[1][0][1] = 6
\$aArray[1][1][0] = 7
\$aArray[1][1][1] = 8

For \$a = 0 to 1
for \$b = 0 to 1
for \$c = 0 to 1

ConsoleWrite(\$aArray[\$a][\$b][\$c] & @CRLF)

Next
Next
Next

;Secound Example

Local \$aArraym [2][2][2]=[[[1,2,],[3,4],[5,6],[7,8]]]

For \$a = 0 to 1
for \$b = 0 to 1
for \$c = 0 to 1

ConsoleWrite(\$aArraym[\$a][\$b][\$c] & @CRLF)

Next
Next
Next```

Edited by Mannyfresh31
##### Share on other sites

According to this old post you can only pre assign values to a single dimensional array.

I believe you need to assign the individual elements programmatically.

Phil Seakins

##### Share on other sites

`Local \$aArraym[2][2][2] = [ [ [1,2] , [3,4] ] , [ [4,5] , [7,8] ] ]`

Edited by TheXman

"Any fool can know.  The point is to understand."  -Albert Einstein
"If you think you're a big fish, it's probably because you only swim in small ponds."  ~TheXman

##### Share on other sites

7 minutes ago, TheXman said:
`Local \$aArraym[2][2][2] = [ [ [1,2] , [3,4] ] , [ [4,5] , [7,8] ] ]`

You got it!!! Now all work fine thanks!!!

```;First Example

Dim \$aArray[2][2][2]

\$aArray[0][0][0] = 1
\$aArray[0][0][1] = 2
\$aArray[0][1][0] = 3
\$aArray[0][1][1]  = 4

\$aArray[1][0][0] = 5
\$aArray[1][0][1] = 6
\$aArray[1][1][0] = 7
\$aArray[1][1][1] = 8

For \$a = 0 to 1
for \$b = 0 to 1
for \$c = 0 to 1

ConsoleWrite(\$aArray[\$a][\$b][\$c] & @CRLF)

Next
Next
Next

;Secound Example

Local \$aArraym [2][2][2]=[[[1,2],[3,4]],[[5,6],[7,8]]]

For \$a = 0 to 1
for \$b = 0 to 1
for \$c = 0 to 1

ConsoleWrite("Here I come " & \$aArraym[\$a][\$b][\$c] & @CRLF)

Next
Next
Next```

##### Share on other sites

You're welcome.

"Any fool can know.  The point is to understand."  -Albert Einstein
"If you think you're a big fish, it's probably because you only swim in small ponds."  ~TheXman

##### Share on other sites

19 minutes ago, Mannyfresh31 said:

You got it!!! Now all work fine thanks!!!

Is not a rant. I don't rant. Well, maybe.
If there was a standard to add "[Solved]" to the title would help me not read, it'd also show that the question was
...  just a wish of mine

Follow the link to my code contribution ( and other things too ).

##### Share on other sites

@argumentum ok I'll add the "[Solved]" just to make you happy (; Today is your day baby!!

##### Share on other sites

Thanks.
It may sound silly but to prefix the [Solved] to the title does help those looking to participate in finding a solution and also helps those looking for a solution

Follow the link to my code contribution ( and other things too ).

##### Share on other sites

@argumentum You Got It!!!

## Create an account

Register a new account

• ### Similar Content

• #### How to convert String to Array without any delimiters?

By LWC,

• 6 replies
• 274 views
• #### Array sort by length (1D)

By Zedna,

• 378 views
• #### poker game (The first steps of using arrays)

By ioa747,

• 10 replies
• 925 views
• #### Help with delete row from array if value exist in cell

By kemo1987,

• 4 replies
• 568 views
• #### delete rows from array if just 1 empty cell exist

By kemo1987,

• 3 replies
• 410 views
×

• Wiki

• Back

• #### Beta

• Git
• FAQ
×
• Create New...