Thread Tools Display Modes
Prev Previous Post   Next Post Next
02-24-09, 06:19 PM   #1
Hati-EK
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 20
Expanding tables with loops

I have a simple question ... my current test code (tested in Wowlua and Omnibus, both times the same error) seems to have a bug - but i am unable to get it ...


Error Message: attempt to index field '?' ( a nil value )

Testcode:
Code:
local x = {}
local k = 1

while name~=nil do
   local name,rank,rankIndex,level,LOclass,zone,_,_,online,status,englishClass =GetGuildRosterInfo(k)
   x[k].n="Test"
   x[k].r=rank
   x[k].l=level
   x[k].c=LOclass
   x[k].z=zone
   x[k].on=online
   x[k].realClass=englishClass
   k=k+1
end

DEFAULT_CHAT_FRAME:AddMessage(x[1].n)
hope someone can enlight me
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Expanding tables with loops


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