lua - How can i update a variable everytime i call it? -


for example, have variable math, don't want rewrite equation time, call variable math again.

how make math again every time call it? because though x,y , z change values throughout script, math returning same value.

or if there's way of doing need.

   math = (x+y-z)     print(math) -- same value     -- lines later     print(math) -- same value again 

try this:

math = function () return (x+y-z) end print(math()) 

Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

php - Redirect and hide target URL -