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++:

lua
{
	x = 10
}
lua_getglobal("x")
console(lua_tonumber(1))

n++ example

Example of lua_getglobal being used with n++:

@lua
{
	x = 10
}
@lua_getglobal("x")
@console(@lua_tonumber(1))