我想找到的條目數爲test[0]
的Lua複雜的表格/列表大小
test = {}
test[0] = {}
test[0].x = {}
test[0].x[0] = 1
test[0].x[1] = 1
test[0].x[2] = 1
test[0].y = {}
test[0].y[0] = 1
我期待table.getn(test[0])
爲2條目test[0].x
和test[0].y
,但它的結果爲0這是爲什麼,和我需要做些什麼來獲得我正在尋找的東西?
我發現'for _對(tab)做count = count + 1 end'這個問題。 – Lono
我不知道你需要這個計數... – lhf