Variables

BlocklyProp reference for VARIABLES blocks

Compatible with all Propeller board types (except Scribbler Robot)


set variable

The set variable block allows you to create a variable and assign it an initial value. Once that is done, you can use this block to access any variable you have created to use it elsewhere in the program.

  1. Click the item dropdown and choose name, then type in a unique name for your variable.  See About Naming Things for the rules.
  2. Attach an initial value with either a number value block, or a text string value block.

Now, any time you want to change the value of your variable in the program again, you can use this block and select its name from the item drop-down.  Your variable will also be accessible from any other block that has an item dropdown menu, such as the use variable block below.


use variable

The use variable block provides the value of the variable selected in the dropdown menu, when inserted into other blocks.