PalmTree Posted November 22, 2012 Posted November 22, 2012 How i do get table string, no number? Like this: local poland = { ["Pivac"] = { ["Beer"] = { ["Brieck"] = {collor="Yellow"}, ["Grass"] = {collor="Green"} } } } now i need know how i get 'brieck' and 'grass' at same time. so not 'poland.Pivac.Brieck' i tried using for i = 1, #poland do outputDebugString(poland.Pivac.Beer[i]) end but no work thanksyou from Poland
Anderl Posted November 22, 2012 Posted November 22, 2012 Because "Beer" is a non-number indexed table and you're trying to call a key number. for k,v in pairs( poland.Pivac.Beer ) do outputDebugString( k .. " = " .. v.collor ); end This will output: Brieck = Yellow Grass = Green
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now