Skip to content

Creating and using variables

bartbutenaers edited this page Aug 14, 2018 · 1 revision

Variables are used to store information (in memory). This way you can use that information in the next Blockly statements.

The animation below will explain how to achieve the following steps:

  1. Create a variable 'myVariable'.
  2. Store some information 'myInformation' in that variable.
  3. Read the information stored in that variable, and log it in the debug panel.

blockly_variables

Multiple variables can be created. All variables will be created in a dropdown list, in which the required variable can be selected. The animation below will explain how to achieve the following steps:

  1. Create a first variable 'myFirstVariable'.
  2. Create a second variable 'mySecondVariable'.
  3. Store some information 'myInformation' in that second variable.
  4. Rename the second variable to 'myNewVariable'.

blockly_variable_multiple