# Adding a Number and a String

There is a block that displays a message on the screen, and you can write a variable of any type (string, number, table, or list) in the message. There is also a block that allows you to assign a value to a variable, and you can use up to 10 variables.

There is a variable a1 that stores some text, for example, 123. To denote the value as text, we will enclose it in quotes. There is also a variable a2 that stores a number; assign it the value 456. You need to connect the blocks in such a way that you first assign values to the variables and then display the resulting message on the screen. For this, an auxiliary text variable a3 is required, which has no initial value.

![](https://sherparpa.ru/wp-content/uploads/2024/02/2024-02-19_20-53-27.png)

Save the diagram and the project to run the created script.

<figure><img src="https://sherparpa.ru/wp-content/uploads/2024/02/2024-02-19_21-02-22.png" alt=""><figcaption></figcaption></figure>

You need to combine the contents of variables a1 and a2. It is logical that when adding a number and a string, the result will be a text string. Choose a3 as the target variable, where the result of the calculation will be placed. For the value of variable a3, write a1+a2, i.e., the result will be a text string containing the values of these variables: 123456.

![](https://sherparpa.ru/wp-content/uploads/2024/02/2024-02-19_21-04-47.png)

Note: since non-absolute values and non-constants are used, but rather variables, the symbol $ must be placed before the name of each variable.

Next, in the message window, you need to display the value of variable a3. You can type the variable in the "Message" field in the properties of the block:

![](https://sherparpa.ru/wp-content/uploads/2024/02/2024-02-19_21-05-57.png)

Or you can select it from the list in the expression editor window by clicking the button with three dots to the right of the field. All user variables are listed under the "Variables" category.

![](https://sherparpa.ru/wp-content/uploads/2024/02/2024-02-19_21-22-56.png)

Next, you need to double-click on the line with variable a3 and click OK. After that, save and run the script. The result:

![](https://sherparpa.ru/wp-content/uploads/2023/11/image79-228w135h-2.png)

Thus, the calculations are performed in the first block, and the second block only displays the result of the expression on the screen.
