Strange behavior of new variables

There is a project

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.

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?

2 Likes

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.