Thread Tools Display Modes
03-20-09, 09:06 AM   #1
flaska
A Theradrim Guardian
AddOn Compiler - Click to view compilations
Join Date: Dec 2006
Posts: 65
Find associative keys in table

if I create a table with associative keys, i.e:

Code:
db = {}
db["[20/3]Event1"] = bla
db["[21/3]Event2"] = bla
..then how do I list the elements? foreach wouldn't work, right?

Is there any way to look through assoc table values without knowing the keys?
  Reply With Quote
03-20-09, 09:28 AM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Code:
for k,v in pairs(db) do
     print(k,v)
end
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
03-20-09, 09:39 AM   #3
flaska
A Theradrim Guardian
AddOn Compiler - Click to view compilations
Join Date: Dec 2006
Posts: 65
Thanks alot! You made me feel really stupid, too ^^
__________________
Slint
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Find associative keys in table

Thread Tools
Display Modes

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