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 its key. This function is used to access specific configuration or runtime variables stored within a VariableMap structure.

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 and retrieve the desired variable from the VariableMap.

Returns

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