Log In  
Follow
tsgibbs
[ :: Read More :: ]

Hello, hopefully I've posted this in the correct area, the BBS is a little confusing.

The three lines below are really troubling me.
The first one demonstrates that we have access to i, x, and y.
The second one demonstrates that we have access to a[1][1][1].
The third one should evaluate to a[1][1][1] which we have access to and stores the value "0", but instead it crashes.

The code:

print(i..x..y) -- returns "111"
print(a[1][1][1]) -- returns "0" which is the correct value stored there
print(a[i][x][y]) -- error

The error:

print(a[i][x][y]) -- error
attempt to index field "?" (a nil value)

Does anyone know why it works this way? Any advice on the correct syntax? I can post the full code if needed, but it's somewhat obfuscated in favor of fewer characters.

Thanks for reading!

P#90827 2021-04-20 01:44