package.seeall
From GMod Wiki
Function | |
Syntax |
package.seeall( Table module ) Where is this used? |
Description: | |
Sets a metatable for module with its __index field referring to the global environment, so that this module inherits values from the global environment. To be used as an option to function module. | |
Returns: | nil |
Part of Library: | package |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Package.seeall]Package.seeall [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Description | This function is used instead of "local (global_name) = (global_name)" to use global functions and tables in modules. |
---|---|
Used on | |
Code | Without package.seeall (Source Code)
local vgui = vgui local table = table local pairs = pairs local pcall = pcall local ScrW = ScrW local ScrH = ScrH local Msg = Msg local unpack = unpack require("timer") local timer = timer module("vguix") With package.seeall (Source Code) module("cookie", package.seeall) |
Output | N/A |
Additional Notes
- Use this function if you need to use a lot of global libraries and functions in a module.
- This function should only be used as a parameter to the module function, it should not be called directly.
See Also
- package (Library)
- module
- package.seeall in the Lua 5.1 Reference Manual