Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-20-12, 07:09 AM   #1
Lur
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jan 2012
Posts: 3
How to obtain vale count from table?

Hello everyone.
I got a small problem writing a little addon.

There is GetGossipAvailableQuests() frunction

Let's imagine we are talking with a NPC with 3 available quests. So if I want to iterate all returned quests, I write something like:
Code:
local q = {GetGossipAvailableQuests()} 
for i=1, #q, 5 do 
   print(q[i])
end
The question is:
1. why #q returns correct count while documentation says that next after first nil value index are returned even if there are another non-nil values
2. why select("#", q) doesn't work correct then?

Thanks a lot!
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » How to obtain vale count from table?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off