fn: lua_getglobal
[contents]

Contents

Syntax

The syntax for lua_getglobal calls is:

f++:  
lua_getglobal(string)

n++:  
@lua_getglobal(string)

Description

The lua_getglobal function pushes the value of the global specified by the string input parameter on to the Lua stack, it is a binding for this function.

f++ example

Example of lua_getglobal being used with f++:

  1. lua
  2. {
  3. x = 10
  4. }
  5. lua_getglobal("x")
  6. console(lua_tonumber(1))

n++ example

Example of lua_getglobal being used with n++:

  1. @lua
  2. {
  3. x = 10
  4. }
  5. @lua_getglobal("x")
  6. @console(@lua_tonumber(1))