View Single Post
  #7  
Unread 06-15-2016, 03:43 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 340
I would recommend reading up on variable scoping. A simple tutorial specific to Lua can be found at:
http://lua-users.org/wiki/ScopeTutorial

iirc that tutorial does leave out one important thing, iterators are always local, for instance, in the line
"for k,v in pairs(test) do"
the variables k and v are automatically local to their iterative loop (you don't need to explicitly create them as local variables first).

Last edited by Garan : 06-15-2016 at 03:53 PM.
Reply With Quote