lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Enno Rehling wrote:
> I am loading a bunch of user-scripts from a list of files, and I'm 
> wondering how to keep them from messing with each other. If I have
two 
> scripts defining the same identifier in the globals table (like two 
> functions called action(), or two variables called size), One of
those 
> scripts is going to puke.

Variables can be declared local to a file:

--one.lua--
local fred 
...

--two.lua
local fred
...

These are quite separate variables!  It's like file scope in C.

steve d.




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.