lua-users home
lua-l archive

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


Maybe a stupid question - how do you implement the functionality of the old "getglobal" tag in the work 3 version? That is, I want to fire my method when a script tries to access a global variable that doesn't exist, but *not* fire when a script accesses a global that does exist. I tried catching the "gettable" method on the globals table, but now I get *everything*: access to all globals and functions, including built-ins like print().

FYI, this is for a component system. When the user does something like 'local x = MyPackage.MyService()', I want to see if a "package" named "MyPackage" (a DLL or .zip of scripts) exists. If it does I load, create a Lua table to represent it, and then stick it into the globals table.

Jason
379