lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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/