Environment

getgenv

Returns the global executor environment table.

Syntax

getgenv(): table

Returns

NameTypeDescription
environmenttableEnvironment table for the selected context.

Description

Returns the global executor environment table.

Call it without parameters. The function reads the needed context from the current runtime state.

It returns environment (table). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = getgenv()
print(result)