blockly > Procedures > rename
Procedures.rename() function
Rename a procedure. Called by the editable field.
Signature:
export declare function rename(this: Field, name: string): string;
Parameters
Parameter |
Type |
Description |
this |
Field |
|
name |
string |
The proposed new name. |
Returns:
string
The accepted name.
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 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `Procedures.rename()` function is used to change the name of a procedure within Blockly."],["It is triggered by the editable field associated with the procedure's name."],["This function takes the proposed new name as input and returns the accepted name after validation."],["The function is associated with a `Field` object representing the editable field."]]],["The `Procedures.rename()` function allows renaming a procedure, triggered by an editable field. It accepts a string `name` as the proposed new name for the procedure. The function's context is a `Field` object. Upon execution, it returns a string representing the accepted name, which may be the same as or different from the input name.\n"]]