Thread Tools Display Modes
06-04-08, 08:45 PM   #1
Raden101
A Murloc Raider
Join Date: May 2008
Posts: 5
Help with tables.

Iv been tring to do this for some time now and i cant seem to find how to do it in any lua libs. or anything. i want to call strings from a table thats in a table

Code:
TB1 = {};

TB1[1] = {
    "I want to call this",
    "Or this",
    "Or even this"
};
and im trying to call it from this..

Code:
local Des1 = getglobal("Form".."Des1Label".."Label");
Des1:SetText(TB1.TB1[1].Key);
any help would be great thanks...



Moving to Lua help oops

Last edited by Raden101 : 06-04-08 at 09:02 PM. Reason: moving to the right area..
  Reply With Quote
07-03-08, 07:54 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
I had the some issues with tables when writing rFilter2. This is what worked for me:

Code:
http://rothui.googlecode.com/svn/tru...2/rFilter2.lua

Code:
    rf2_spell_list = {
      buffs = {
        [1] = { tag = "battle", spellid = 2048, unit = "player", size = 32, fontsize = 24, posx = 0, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
        [2] = { tag = "commanding", spellid = 469, unit = "player", size = 32, fontsize = 24, posx = 40, posy = 0, framestrata = "BACKGROUND", anchor = "UIParent"},
      },
Code:
      for index,value in ipairs(rf2_spell_list.buffs) do 
        local string = rf2_spell_list.buffs[index]
        addon:rf2_create_icon(string.spellid,"rf2_"..string.tag,string.size,string.fontsize,string.posx,string.posy,string.framestrata,string.anchor)
      end
Hope this is what you are looking for.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
09-02-08, 10:12 AM   #3
RiZLA
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 3
Is this in the correct forum?

this seems like a very useful question/answer for general wow lua, so why is it posted in a forum dedicated to a project that died 2 years ago?

oh, I presume your "Moving to Lua help" failed, one way or another.

Last edited by RiZLA : 09-02-08 at 11:07 AM.
  Reply With Quote
09-02-08, 10:27 AM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
The project didn't die 2 years ago, it just hasn't seen much activity. There have been several updates to it, including one yesterday.
__________________
"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
09-02-08, 11:13 AM   #5
RiZLA
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 3
o,rly?

so where is the download link maintained?
wowuides.wowinterface.com no longer works.

EDIT: ok I found it, should be added to the faq here or something
http://www.wowinterface.com/download...fo.php?id=4222

Last edited by RiZLA : 09-02-08 at 11:18 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Help with tables.


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