[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: A question about table's length
- From: h visli <h_visli@...>
- Date: Tue, 29 Dec 2009 17:03:12 +0800 (CST)
Hello all,
I'm a newbie of the Lua world. Here is my code:
a = {}
a[1] = 1
a[2] = nil
a[3] = 3
print('Length of a: ' .. #a)
b = {1, nil, 3}
print('Length of b: ' .. #b)
The result:
Length of a: 1
Length of b: 3
Why the length of b is not equal to 1?
Thank you!
Visli
___________________________________________________________
好玩贺卡等你发,邮箱贺卡全新上线!
http://card.mail.cn.yahoo.com/