I'm new to Lua and dealing with Lua as a scripting language in an alpha release of a program. The developer is unresponsive and I need to get a list of functions provided by some C++ objects which are accessible from the Lua code.
Is there any easy way to see what fields and functions these objects expose?
If allowed in the environment, looking at the metatable of the exported C++ object can help:
In Lua, to view the members of a object, you can use:
Unfortunately I don't know if this will work for objects imported from C++.
Print all the globals:
source: http://www.lua.org/cgi-bin/demo
Output:
Something along the same vein as the answer Mr Stinky gave but a whole lot more information.
I made the below code originally for a running from a web server but have added the capability to run on lua for windows
on a web server options are passed in query string ?loadmodules=no&module=_G
in program form options are passed on command line functs loadmodules no module _G
if run with no arguments all modules in pkgpath are loaded and parsed
Sample Output