Settings

            

Variables

We use variables for storing data. They have a name and a type. The type says what type of data we can store in it. For example, if we are calculating total amount we spent on some items, we could use these 3 variables:


Before we use it, we must declare a variable. Right click on the edge and add a "Declare" block. Click on it and then:

Do the same for price, set its type to Real and value to 1.5

Now we can finally calculate the total amount. Declare total, set its type to Real and value to amount * price

This last part is very important. You can use variable name as a value! Of course, you should also add "Output" with value total, so you can see that it works!

CodeExploreLearnLog In