Stay organized with collections Save and categorize content based on your preferences.

blockly > Variables > promptName

Variables.promptName() function

Prompt the user for a new variable name.


export declare function promptName(promptText: string, defaultText: string, callback: (p1: string | null) => void): void;


Parameter Type Description
promptText string The string of the prompt.
defaultText string The default value to show in the prompt's field.
callback (p1: string | null) => void A callback. It will be passed the new variable name, or null if the user picked something illegal.