Variables is the last category of blocks, and it carries over 11 commands, and 12 reporters. These blocks are used for variables. The variables pane also contains list and "other" blocks. There have been various discussions on the creation of 'cloud variables' as there are in the well known block programming website (which Snap! is based off) Scratch. The Snap! developers have said that they will not be adding these 'We're a little afraid of them, because it's one more thing to have to police, but people finding a way to use someone else's cloud variable server is a perfect solution!'. The Snap! developers have allowed users to create there own cloud variable systems which they can run off their own servers. Many users have created there own servers to run 'cloud variables' on, they are only accessible through block downloads as the previous quote sums, the Snap! developers do not want anything to do with these sorts of variables.
Block | Function | Options |
---|---|---|
(variable) | Gets the value of a variable named by the block spec. | No other block reads its own block spec. A new one is added to the palette whenever a variable is made. |
set [ V] to [0] | Sets a variable to the value. | Global variable names, local variables of the current sprite, and a submenu labeled "my" with properties of the current sprite |
change [ V] by (1) | Changes a variable's value | Global variable names, local variables of the current sprite. |
show variable [ V] | Shows a variable. | Global variable names, local variables of the current sprite. |
hide variable [ V] | Hides a variable | Global variable names, local variables of the current sprite. |
script variables ((a)) @addInput | Creates temporary variables used in scripts | These variable names can be changed by clicking on them in the grey block. Right-clicking gives the option to rename all, which applies to all variables in the script with the same name. see: Upvars |
inherit [ V] | Removes a variable or attribute from a clone. Any attempt to get or set that value will affect the parent instead. | Global variable names, local variables of the current sprite, and a submenu labeled "my" with properties of the current sprite |