Stay organized with collections
Save and categorize content based on your preferences.
blockly > Events > VarRename > (constructor)
Events.VarRename.(constructor)
Constructs a new instance of the VarRename
class
Signature:
constructor(opt_variable?: IVariableModel<IVariableState>, newName?: string);
Parameters
Parameter |
Type |
Description |
opt_variable |
IVariableModel<IVariableState> |
(Optional) The renamed variable. Undefined for a blank event. |
newName |
string |
(Optional) The new name the variable will be changed to. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-16 UTC."],[[["The `Events.VarRename` class constructor creates a new instance of the `VarRename` class, signifying a variable rename event within Blockly applications."],["This constructor optionally accepts the `VariableModel` object of the renamed variable and the variable's new name as parameters."],["These parameters, `opt_variable` and `newName`, help in defining the specifics of the variable rename event."]]],["The `VarRename` class constructor creates a new instance for renaming a variable. It accepts two optional parameters: `opt_variable`, a `VariableModel` representing the variable being renamed, and `newName`, a string specifying the variable's new name. If `opt_variable` is undefined, it indicates a blank event. The class facilitates the process of tracking and applying variable name changes within the system.\n"]]