AddOns
AddOn Manager
Latest 200
Browse
Upload AddOn
Search AddOns
Projects
Author Portals
Git Repositories
SVN Repositories
Options
Email Feeds
Preference
Download History
News
Forums
New posts
Today's Posts
Search Forum
Categories
General
AddOns, Comps, Macros
Featured Projects
Developer
Site Forums
Mark Forums Read
Subscribed Threads
Open Buddy List
Members List
Help
Login
Sign up
WoWInterface
»
Developer Discussions
»
Lua/XML Help
»
Find associative keys in table
Go to Page...
Reply
View First Unread
Thread Tools
Display Modes
03-20-09, 09:06 AM
#
1
flaska
A Theradrim Guardian
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?
flaska
View Public Profile
Send a private message to flaska
Find More Posts by flaska
03-20-09, 09:28 AM
#
2
Seerah
Fishing Trainer
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
Seerah
View Public Profile
Send a private message to Seerah
Find More Posts by Seerah
03-20-09, 09:39 AM
#
3
flaska
A Theradrim Guardian
Join Date: Dec 2006
Posts: 65
Thanks alot! You made me feel really stupid, too ^^
__________________
Slint
flaska
View Public Profile
Send a private message to flaska
Find More Posts by flaska
Reply
WoWInterface
»
Developer Discussions
»
Lua/XML Help
» Find associative keys in table
«
Previous Thread
|
Next Thread
»
Thread Tools
Show Printable Version
Email this Page
Display Modes
Linear Mode
Switch to Hybrid Mode
Switch to Threaded Mode
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