# \[SOLVED\] When you meet the Endless loop while using the Thunkable（；´д｀）ゞ

**URL:** https://community.thunkable.com/t/solved-when-you-meet-the-endless-loop-while-using-the-thunkable/2607030
**Category:** Issues / Bugs
**Tags:** beginner, help
**Created:** [September 21, 2023, 3:13pm UTC](https://community.thunkable.com/t/solved-when-you-meet-the-endless-loop-while-using-the-thunkable/2607030 "2023-09-21T15:13:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![yihao\_wp0bze](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yihao\_wp0bze](https://community.thunkable.com/u/yihao_wp0bze)
#### Post date: [September 21, 2023, 3:13pm UTC](https://community.thunkable.com/t/solved-when-you-meet-the-endless-loop-while-using-the-thunkable/2607030/1 "2023-09-21T15:13:55Z")

</div>

This is the requirement to use the loop like while or count in Thunkable.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/4/94faa0b2173a9e543430c79e51c01b6e10428dea.png)

But my codes fell into the Endless loop（；´д｀）ゞ

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/c/0c2da723c7df041ab17c1701b813b821477c6952.png)

I don’t know what’s wrong with it, which takes me 2h to find the problems but failed. Do you know how to make the correct codes and avoid the Endless loop?

---

<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: [September 21, 2023, 3:44pm UTC](https://community.thunkable.com/t/solved-when-you-meet-the-endless-loop-while-using-the-thunkable/2607030/2 "2023-09-21T15:44:10Z")

</div>

You have an endless loop because the value of i2 starts out as 4 which is greater than or equal to 1 and it never changes inside of the loop. So the `while` condition is always true.

Just an aside that I find it really confusing that you’re using numbers within your variable names. I don’t recommend that.

An easier way to solve this is to consider “1234” as text rather than a number and use the substring block in the Text drawer to shorten the text string each time through the loop. If you’re required to use math blocks then I recommend renaming i2 and j2 to define what they actually are used for and then figuring out when the value of i2 should change inside of your loop. A math method would be to divide the number by 10 and round down since 1234/10 = 123.4 which rounds to 123; 123/10 = 12.3 which rounds down to 12; etc.

---

<div class="post-metadata">

### Author: ![yihao\_wp0bze](https://avatars.discourse-cdn.com/v4/letter/y/97f17d/32.png) [@yihao\_wp0bze](https://community.thunkable.com/u/yihao_wp0bze)
#### Post date: [September 26, 2023, 12:55am UTC](https://community.thunkable.com/t/solved-when-you-meet-the-endless-loop-while-using-the-thunkable/2607030/3 "2023-09-26T00:55:54Z")

</div>

Sorry,because of study, I didnt’t notice your answer, but thanks for your sinserely help.

---

<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: [September 27, 2023, 10:54am UTC](https://community.thunkable.com/t/solved-when-you-meet-the-endless-loop-while-using-the-thunkable/2607030/4 "2023-09-27T10:54:08Z")

</div>


