Thursday, 17 November 2011

Corona Local Vars

So last night I had 20 mins to spare after dinner at me mams house.
Just realised that if you dont mark a variable as "local" then you can access this if its sat in seperate module

sooo having the below in the main.lua....


local testlib = require("testlib")
print("testlib.hello")

....Will print what ever hello is equal to.

Local I suppose is the equivalent of a private variable in flash class.



No comments: