Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
en:programmingblocks:variables [2018/05/04 15:12]
kniwwelino [Blocks]
en:programmingblocks:variables [2018/05/04 15:17] (current)
kniwwelino [Example]
Line 1: Line 1:
 +===== Variables =====
 +
 +==== Blocks ====
 +
 +=== Get variable ===
 +{{:en:programmingblocks:variable_1.png|}}
 +
 +Returns the value which is currently stored in the variable of the selected name.
 +
 +Options: The dropdown list shows you all the variables which were defined by the block ''set variable''.
 +
 +\\
 +=== Set variable ===
 +{{:en:programmingblocks:variable_2.png|}}
 +
 +Assigns a value to a variable. In case a value was already assigned to this variable, this value will be overwritten.
 +
 +Options:
 +  * You can select one of the names available in the dropdown (e.g. ''value''). These are the names of the variables previously defined.
 +  * ''Rename variable'': With this option you can specify a new name for this variable. All variables with this name in the program will then be renamed.
 +  * ''New variable'': With this option you can enter a new name for the variable, without impacting any other variables in the program.
 +
 +\\
 +=== Set variable to a specific type ===
 +{{:en:programmingblocks:variable_3.png|}}
 +
 +Converts a value to specific type and stores the result in a variable.
 +
 +\\
 +=== Convert value to a specific type ===
 +{{:en:programmingblocks:variable_4.png|}}
 +
 +Converts a given value (or variable) to a specific data type.
 +
 +Options:
 +  * ''Character''
 +  * ''Text''
 +  * ''Boolean''
 +  * ''Short number''
 +  * ''Number'' 
 +  * ''Large number''
 +  * ''Decimal''
 +==== Example ====
 +
 +This example shows a simple use of the variable. The text ''Hello Kniwwelino!'' is first stored in the variable named ''value''. In the next line then, the content of this variable is written on the matrix.
 +
 +{{:en:programmingblocks:variable_example.png|}}
 +
 +You can find another example of how to use the variable in the sample project [[en:instructions:rockpaperscissors|]].
 +
 +
  
  • en/programmingblocks/variables.txt
  • Last modified: 2018/05/04 15:17
  • by kniwwelino