The debug.getinfo return value

No matter what the argument, the debug.getinfo function will return a table. This table will contain information about the function being inspected. When called with an integer, the return table will contain the following fields/variables:

  • source: Where the function is defined. This will contain the name of the file that a function is defined in.
  • short_src: A short textual version of the function, up to 60 characters.
  • linedefined: The first line of the source file where the function was defined.
  • lastlinedefined: The last line in the source file where the function was defined.
  • what: If the function is a "Lua" or a "C" function, the appropriate string will be returned.
  • name: Lua's best guess at the name of the function. In Lua, functions can be assigned to multiple variables, so the name really is a guess most of the time.
  • namewhat: What the name field is: a "global" variable, a "local" variable, a "method", a "field", or unknown ("").
  • nups: The number of up values for the function.
  • activelines: The number of lines a function contains. White spaces and comments are ignored.
  • func: The actual function; you can call this.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.188.201