Skip to main content

GetVariable

Retrieves a variable from a VariableMap by key. Returns nil if the key is not found or if the VariableMap is nil.

def GetVariable(
vm: *core.VariableMap,
key: string
) - > *core.Variable

Retrieves a variable from a VariableMap by key. Returns nil if the key is not found or if the VariableMap is nil.

Parameters

NameTypeDescription
vm*core.VariableMapThe VariableMap from which to retrieve the variable. If nil, the function will return nil.
keystringThe string key used to identify the variable within the VariableMap.

Returns

TypeDescription
*core.VariableThe core.Variable associated with the key, or nil if not found or the VariableMap is nil.