Thread Tools Display Modes
Prev Previous Post   Next Post Next
10-23-10, 01:47 AM   #1
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Using a function in a table as a variable?

Is it possible to use locals or functions in a table of variables? so lets say you have this...

mytable = {
["scale"] = 1,
}

would it be possible to do something like this

local scale

function addon:FigureScale()
do some stuff to get the scale
scale = result
end

mytable = {
["scale"] = scale,
}

or

mytable = {
["scale"] = addon:FigureScale(),
}

??? or some other method that would give me the same functionality?
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Using a function in a table as a variable?


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