# Strange behavior of new variables

**URL:** https://community.thunkable.com/t/strange-behavior-of-new-variables/130823
**Category:** Questions about Thunkable X
**Created:** [July 3, 2019, 7:48pm UTC](https://community.thunkable.com/t/strange-behavior-of-new-variables/130823 "2019-07-03T19:48:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [July 3, 2019, 7:48pm UTC](https://community.thunkable.com/t/strange-behavior-of-new-variables/130823/1 "2019-07-03T19:48:17Z")

</div>

There is a project

[https://x.thunkable.com/projects/5d1660bc66cfa2bac5c0d32b/project/properties/designer/](https://x.thunkable.com/projects/5d1660bc66cfa2bac5c0d32b/project/properties/designer/)

The image shows a variable of the old type, which is created as a parameter from a function block.

 ![%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/7/27aafe71cdfb3a9982f8927276ed6a40e1c7b87f.png)

In this case, the algorithm works (new coordinates are updated in the list).

If this variable is replaced with a variable of type “app”, “cloud” or “stored”, then the algorithm for moving the shape stops working (the new coordinates are not updated in the list). I can explain this by the fact that a variable created from a function block takes a value by reference, and variables of type “app”, “cloud” or “stored” - by value. Do I understand this subtle difference correctly?

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [July 4, 2019, 8:00am UTC](https://community.thunkable.com/t/strange-behavior-of-new-variables/130823/2 "2019-07-04T08:00:17Z")

</div>

My experiments showed that in simple cases, the behavior of the global variables “app” and the variable created from function block work in the same way. But in this situation, there was an anomaly in the work of a variable created from a function block, thanks to which the link operation mechanism was activated - when the properties of an object referring to an object in the list are changed, the object itself changes in the list, which does not happen when using the “app” block as a list of objects.

Perhaps Mark recommends using global variable blocks for the reason that in some cases strange work of variables created from a function is possible.

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 12:12pm UTC](https://community.thunkable.com/t/strange-behavior-of-new-variables/130823/3 "2024-11-08T12:12:22Z")

</div>


