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

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -