fn: lua_gettop
[contents]

Contents

Syntax

The syntax for lua_gettop calls is:

f++:  
lua_gettop()

n++:  
@lua_gettop()

Description

The lua_gettop function takes zero parameters and returns the number of elements in the Lua stack, which is the index of the top element in the stack, it is a binding for this function.

f++ example

Example of lua_gettop being used with f++:

lua_pushnumber(14)
console(lua_gettop())

n++ example

Example of lua_gettop being used with n++:

@lua_pushnumber(14)
@console(@lua_gettop())

Sponsors