Skip to main content

Function: deleteVariable()

function deleteVariable(
workspace,
variable,
triggeringBlock?
): void;

Defined in: packages/blockly/core/variables.ts:849

Delete a variable and all of its uses from the given workspace. May prompt the user for confirmation.

Parameters

ParameterTypeDescription
workspaceWorkspaceThe workspace from which to delete the variable.
variableIVariableModel<IVariableState>The variable to delete.
triggeringBlock?BlockThe block from which this deletion was triggered, if any. Used to exclude it from checking and warning about blocks referencing the variable being deleted.

Returns

void