Environment.lookupVariableOrConst

Attempts to look up existing variable or const throughout the stack. If found, returns a pointer to the variable location, and if it is const, sets isConst to true. Note, this pointer should not be stored by native functions because the variable table may be modified between function calls.

class Environment
lookupVariableOrConst
(
in string varName
,
out bool isConst
)

Parameters

isConst bool

Whether or not the found variable is constant. Will remain false if variable is not found

Return Value

Type: ScriptAny*

A pointer to the located variable, or null if the variable was not found. If this value is needed for later the caller should make a copy of the variable immediately.

Meta