Stay organized with collections
Save and categorize content based on your preferences.
blockly > Names > setVariableMap
Names.setVariableMap() method
Set the variable map that maps from variable name to variable object.
Signature:
setVariableMap(map: IVariableMap<IVariableModel<IVariableState>>): void;
Parameters
Returns:
void
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."],[[["\u003cp\u003eThe \u003ccode\u003eNames.setVariableMap()\u003c/code\u003e method associates variable names with their corresponding variable objects using a \u003ccode\u003eVariableMap\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThis method accepts a \u003ccode\u003eVariableMap\u003c/code\u003e as input to establish the mapping and does not return any value.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [Names](./blockly.names_class.md) \\\u003e [setVariableMap](./blockly.names_class.setvariablemap_1_method.md)\n\nNames.setVariableMap() method\n-----------------------------\n\nSet the variable map that maps from variable name to variable object.\n\n**Signature:** \n\n setVariableMap(map: IVariableMap\u003cIVariableModel\u003cIVariableState\u003e\u003e): void;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|\n| map | [IVariableMap](./blockly.ivariablemap_interface.md)\\\u003c[IVariableModel](./blockly.ivariablemodel_interface.md)\\\u003c[IVariableState](./blockly.ivariablestate_interface.md)\\\u003e\\\u003e | The map to track. |\n\n**Returns:**\n\nvoid"]]