View Single Post
Old 12-18-12, 04:12 PM   #5
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 122
Originally Posted by Seerah View Post
If you take away the "local", then yes - it will be a global. Unless you declare that variable as local in your upvalues (outside of the function, therefore local to your whole Lua file.)
Thanks all.

So with this example, just so I've got it straight in my head:

Lua Code:
  1. M.GetData_CalculateListingValue = function(announce)
  2.     announce = (announce or false);
  3.     -- doing stuff with announce
  4. end

The function argument 'announce' will now be a global because it wasn't declared local within the function?
__________________
__________________
Aanson is offline   Reply With Quote