lua-users home
lua-l archive

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


Was mixing the table (as associated arrays) and regular array semantics, and results surprised me a bit.

[code]
-- initially declared xyz as an array of length 12
xyz = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L'}

xyz[110] = 'N'
print(#xyz)

xyz[13] = 'M'
print(#xyz)
[/code]

[output]
12
13
[/output]