# Same blocks in different pages... Could it be done better?

**URL:** <https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164>\
**Category:** Questions about Thunkable X\
**Created:** [December 30, 2021, 11:31pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164 "2021-12-30T23:31:51Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 10, 2022, 7:31pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/21 "2022-01-10T19:31:36Z")

</div>

This is the problem right here:

![7b5d4ffc152ad4bc86f03b5230310a523479bf91](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/7/971a0da81f458feae534140a84c19ad6b842f207.png)

(Sorry, your screenshot was really small so the quality is poor)

You are manually naming the variable as `RowNumVCBLRApp` but there is no variable with that name. The variable you initialized is called `RowNumVCBLR`. I would not use the `set app variable` block you are using. Instead, use the normal `set app variable block` at the top of the Variables drawer where you don’t have to type in the name… you just select it from a drop-down menu.

---

<div class="post-metadata">

**Author:** ![similar2similar](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@similar2similar](https://community.thunkable.com/u/similar2similar)\
**Post date:** [January 10, 2022, 8:17pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/22 "2022-01-10T20:17:48Z")

</div>

Sorry about the size, but actually I have an App variable called RowNumVCBLRApp started, but I don’t really know if I have to “set stored variable RowNumVCBLR to AppvariableRowNumApp” or if it’s the other way around, or if it’s “set AppvariableRowNumApp to StoredvariableRowNum”, and where should I place it. Anyway, it’s going faster than before

 ![Capturaintento nuevo2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/d/4d68c63358724899fb22677fa262f099745db265.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 10, 2022, 9:11pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/23 "2022-01-10T21:11:19Z")

</div>

Sorry for not noticing that.

Even so, I would use the drop-down menus… that’s just me.

You have it backwards. You need to `set app variable` to `stored variable` after the Wait block. What you’re doing is first setting the value of the stored variable (to 1). That saves it to the device. Then, you’re transferring the value to an app variable that will be used throughout the screen. If you ever make a change to the app variable, then you need to save it to the device by doing `set stored variable` to `app variable`.

---

<div class="post-metadata">

**Author:** ![similar2similar](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@similar2similar](https://community.thunkable.com/u/similar2similar)\
**Post date:** [January 10, 2022, 11:38pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/24 "2022-01-10T23:38:41Z")

</div>

As it is a vocabulary list, I suppose to save the changes every time I have loaded the page, after pronouncing Spanish, British and American or after pressing the ‘forward’ or ‘back’ buttons, or is it better somewhere else?

 ![Capturaintento nuevo3](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/6/b63b64a0690291c8bd64bedc031a372b210723bd.png)  
Thanks

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 11, 2022, 12:15am UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/25 "2022-01-11T00:15:12Z")

</div>

That sounds fine. It all depends on how important the saved value is. If it’s lost, how much of a problem is that?

Normally, I just set the stored variable to the app variable any time the value changes. But it’s not required. You could do it when the screen changes or every 30 minutes… it’s up to you!

What does that variable keep track of?

---

<div class="post-metadata">

**Author:** ![similar2similar](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@similar2similar](https://community.thunkable.com/u/similar2similar)\
**Post date:** [January 11, 2022, 12:44pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/26 "2022-01-11T12:44:31Z")

</div>

This variable keeps track of which word should appear on the screen, to prevent unnecessary repetitions, and therefore I think it has to be renewed in each word. Then…,  
Should I put it on the page up and / or back buttons, or just “when xxx opens”? Do I have to change “change stored variable xxx by 1”, or should it be change App variousble xxx by 1 “in” when xxx 0pens "?

 ![Capturaintento nuevo4](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/9/9900b1dee7f297647ccb24e19f85c1f9073ac52f.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 11, 2022, 5:42pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/27 "2022-01-11T17:42:42Z")

</div>

What you have there looks good. The only thing I would do differently is to change the **app** variable by 1 at the bottom. That way both the app and stored variable values get changed. Right now, you’re only changing the stored variable there.

---

<div class="post-metadata">

**Author:** ![similar2similar](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@similar2similar](https://community.thunkable.com/u/similar2similar)\
**Post date:** [January 11, 2022, 5:45pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/28 "2022-01-11T17:45:16Z")

</div>

Thank you very much. A great help.

---

<div class="post-metadata">

**Author:** ![similar2similar](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@similar2similar](https://community.thunkable.com/u/similar2similar)\
**Post date:** [January 11, 2022, 5:52pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/29 "2022-01-11T17:52:08Z")

</div>

And about the forward and backward buttons, do I need the last block "set stored variable xxx to app variable xxx?

 ![Capturaintento nuevo5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/b/5b54cb1493b932f20d05a7ef2381d544ab206c3a.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 11, 2022, 6:11pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/30 "2022-01-11T18:11:46Z")

</div>

Only if you are changing the app variable value. I mentioned this before but I left out the word “app” so it may have been confusing.

I assume that when you go forward or backward, you are going to change the value of the app variable (even though I don’t see it in your screenshot). If you change the app variable value, then save it to the stored variable.

Remember that you _could_ use stored variables only and things would work great. They just might be a tiny bit slow. The advantage of using app variables is speed. The app variables act as temporary storage because if the app is quit or the device turns off, they don’t retain the values. So if you want to save values in case of that happening, you put them in stored variables. So a safe rule of thumb is **any time you change an app variable value, also set the stored variable to that app variable value**.

If you are _not_ changing the app variable value then you don’t need to worry about the stored variable.

---

<div class="post-metadata">

**Author:** ![similar2similar](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@similar2similar](https://community.thunkable.com/u/similar2similar)\
**Post date:** [January 11, 2022, 6:20pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/31 "2022-01-11T18:20:09Z")

</div>

Thanks so much

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [April 11, 2022, 6:21pm UTC](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164/32 "2022-04-11T18:21:09Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

[Previous page](https://community.thunkable.com/t/same-blocks-in-different-pages-could-it-be-done-better/1663164.md?page=1)
