Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-05-10, 10:30 PM   #1
SaraFdS
A Fallenroot Satyr
 
SaraFdS's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 24
declaring local variables inside functions?

A simple(?) question that just came to my mind, when using local variables inside local functions, what's the most efficient and/or fastest way to do so?
Declare it once, outside the function
Code:
local foo = SomeValue
local function goo()
foo = SomeValue
-- do sth w/ foo
end
or declare it each time anew inside the function?
Code:
local function goo()
local foo = SomeValue
-- do sth w/ foo
end
__________________
Sará the Insane
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » declaring local variables inside functions?


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