access to arrays in arrays

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
the underminer
Posts: 123
Joined: Mon Oct 03, 2005 4:25 am
Location: Netherlands

access to arrays in arrays

Post by the underminer »

Say I have following code (don't mind spelling in code, just to give you an idea)

Code: Select all

Borders = {}
LeftBorders = {}
LeftBorders[1] = 54
LeftBorders[2] = 34
Borders[1] = LeftBorders
How can I acces the value of LeftBorders[1]?
I tried

Code: Select all

print(Borders[1[1]])
to print the value of LeftBorders[1] to the winXP console running the lua emulator, but it gave me an error. Something like: expected ']' near '['

Anyone knows a solution?
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

Code: Select all

print(Borders[1][1])
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Post Reply