qaisjp Posted April 13, 2011 Share Posted April 13, 2011 What is the real difference between the following two things. This: helloText = "Hello World" and local helloText = "Hello World" Yes I am talking about "local" - What is it exactly? How does it change when you type/dont type it? Please help Link to comment
proracer Posted April 13, 2011 Share Posted April 13, 2011 For example you can create global variables in 1 lua file and use it within the resource folder, while local variables are more faster then global ones and are most common used. You can read more: http://lua-users.org/wiki/ScopeTutorial Also if I'm not wrong you can use local variables within the whole script or inside the function.Ones inside function are used only in that function while the ones that aren't in function can be used within the whole code. Link to comment
qaisjp Posted April 13, 2011 Author Share Posted April 13, 2011 Aha, so is this also why I see local function jaja() end sometimes? So this function is only accessible and visible to the file ? So I can keep one function called changeText in multiple files (different) and they will only run the one in the file ? THANKS Link to comment
proracer Posted April 13, 2011 Share Posted April 13, 2011 You can download Lua 5.1 and practice with Lua command line (similiar to command prompt) to easily test stuff. Link to comment
Antibird Posted April 13, 2011 Share Posted April 13, 2011 Basically, http://www.lua.org/manual/5.1/manual.html#2.6 Link to comment
qaisjp Posted April 15, 2011 Author Share Posted April 15, 2011 Gr,I hate command line - despite the fact i use it all the time - Okay Thanks again Antibird and proracer. EDIT: EPIC ^ [ size = 1 ] [/ size] Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now