Advertisement

LUA Code Organization

Started by June 19, 2004 10:54 AM
1 comment, last by Muse 20 years, 4 months ago
Hi, how does one organize LUA code, so that, the variables i globally create in one Lua Script are not seen in another. Am I forced to create a function to encapsulate those variables, so that they aren't seen from the "outside" (global)? Is there a way to kill a variable, something like: undefine var; ?
Wouldn't setting the var to "nil" be enough?

You could also have more than one lua context.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Advertisement
If you just declared your variables with 'local' in a script but outside of any specific chunk they'd be visible to everything in the script but not between scripts, I believe.
Is that what you were wondering?
-david

This topic is closed to new replies.

Advertisement