Skip to main content

SetVariable

Adds or updates a variable in a VariableMap. If the key already exists, it updates the value. Otherwise, it appends a new entry.

def SetVariable(
vm: *core.VariableMap,
key: string,
variable: *core.Variable
)

Adds or updates a variable in a VariableMap. If the key already exists, it updates the value; otherwise, it appends a new entry.

Parameters

NameTypeDescription
vm*core.VariableMapThe VariableMap to which the variable will be added or updated.
keystringThe unique identifier for the variable within the VariableMap.
variable*core.VariableThe variable object to be stored or updated in the VariableMap.