[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Help me get the number of items in the table
- From: AndreyCh <sofandr2@...>
- Date: Sat, 29 Jul 2017 14:36:36 +0300
Hi all
Help me get the number of items in the table
Lua 5.1
-- https://codereview.stackexchange.com/questions/14236/very-basic-chatbot
local messages = {
[1] = "Hello stranger!",
["name"] = "I'm Bob, the owner of this little shop.",
["job"] = "I sell stuff.",
["hat"] = {
[1] = "You like my hat?",
["yes"] = "It's nice I know.",
["no"] = "You ...!",
},
}
local topic = messages;
print(">>",#topic); -- 1
The result is 1
But I need that result be 4
Thank you