How print array?
mass = {"one", "two", "three"}
test = "mass" for i, v in pairs(test) do print(v) end Why this code dont work and where error? |
you assign the string "mass" to test. that fails in pairs. you should get a lua error. enable errors.
|
Quote:
Lua Code:
|
try table.foreach
table.foreach(tablename, print) |
Quote:
So when you are trying to iterate through the string variable test it fails as test is not a table. Vrul has provided the actual answer. |
Thanks averyone. Use two-dimensional array
|
All times are GMT -6. The time now is 06:12 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI