# Different between while and until

**URL:** <https://community.thunkable.com/t/different-between-while-and-until/1041834>\
**Category:** Questions about Thunkable X\
**Tags:** loops\
**Created:** [December 28, 2020, 7:02am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834 "2020-12-28T07:02:08Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![v.krishna](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/v.krishna/32/84811_2.png) [@v.krishna](https://community.thunkable.com/u/v.krishna)\
**Post date:** [December 28, 2020, 7:02am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/1 "2020-12-28T07:02:08Z")

</div>

Can anyone tell what is the difference between while and until loop, please

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [December 28, 2020, 7:13am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/2 "2020-12-28T07:13:38Z")

</div>

Hi @v.krishna!  
If I’m not wrong, the ‘while’ loop carries out the same block of code **as long as** a certain property is true, or a certain variable has a certain value, etc.  
For example,

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/b/5bdf20d5ef2478bcf532120bf0f6832293b4cce0.png)  
As long as the text in an input is ‘room’, we are going to do something. When the text is no longer room, we will discontinue that function.  
The ‘until’ loop carries out a function **until a value is no longer the same** , or a function is executed, or a label’s text is different, etc.  
For example,  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/7/e7389b5bc3b658334b55f09a20b2c121f784350c.png)  
The app will do something until the input’s text isn’t room.  
The difference between these two blocks is that the **while** block carries out code as long as certain properties are the same, while the until block carries out until the properties change.  
Happy Thunking!

---

<div class="post-metadata">

**Author:** ![v.krishna](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/v.krishna/32/84811_2.png) [@v.krishna](https://community.thunkable.com/u/v.krishna)\
**Post date:** [December 28, 2020, 7:16am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/3 "2020-12-28T07:16:52Z")

</div>

thanks but they look like same

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [December 28, 2020, 7:18am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/4 "2020-12-28T07:18:28Z")

</div>

> [@codeswept](#):
>
> The difference between these two blocks is that the **while** block carries out code as long as certain properties are the same, while the until block carries out until the properties change.

That’s the difference (@Thunkers, please correct me if I’m wrong, I haven’t used these too much).

---

<div class="post-metadata">

**Author:** ![v.krishna](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/v.krishna/32/84811_2.png) [@v.krishna](https://community.thunkable.com/u/v.krishna)\
**Post date:** [December 28, 2020, 7:20am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/5 "2020-12-28T07:20:10Z")

</div>

i too know the difference but can you just make a gif and show for better understanding

---

<div class="post-metadata">

**Author:** ![v.krishna](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/v.krishna/32/84811_2.png) [@v.krishna](https://community.thunkable.com/u/v.krishna)\
**Post date:** [December 28, 2020, 7:20am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/6 "2020-12-28T07:20:40Z")

</div>

i really need clear explanation

---

<div class="post-metadata">

**Author:** ![v.krishna](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/v.krishna/32/84811_2.png) [@v.krishna](https://community.thunkable.com/u/v.krishna)\
**Post date:** [December 28, 2020, 7:21am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/7 "2020-12-28T07:21:08Z")

</div>

becoz I am making a business app

---

<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:** [December 28, 2020, 8:12am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/8 "2020-12-28T08:12:12Z")

</div>

@v.krishna Please **edit** your posts so that you’re not making so many new posts. It gets very hard to follow the topic when it gets too long. You can post a sentence and then if you have more to add, just edit the existing post and add details. Thanks.

I agree with @codeswept’s explanation. And yes, they are mostly interchangeable. I could be wrong but in other languages I’ve coded in, a _repeat while_ loop that starts out with the condition false will fire **zero** times whereas a repeat until loop that starts out with the condition false will fire **one** time.

---

<div class="post-metadata">

**Author:** ![v.krishna](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/v.krishna/32/84811_2.png) [@v.krishna](https://community.thunkable.com/u/v.krishna)\
**Post date:** [December 28, 2020, 8:14am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/9 "2020-12-28T08:14:53Z")

</div>

> [@tatiang](#):
>
> a _repeat while_ loop that starts out with the condition false will fire **zero** times whereas a repeat until loop that starts out with the condition false will fire **one** time.

that was what I need how many times a repeat loop will fire 🔥 and I think this was the solution and I will definitely follow the advice

> [@tatiang](#):
>
> @eeswarvedampudiwnq Please **edit** your posts so that you’re not making so many new posts. It gets very hard to follow the topic when it gets too long

---

<div class="post-metadata">

**Author:** ![v.krishna](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/v.krishna/32/84811_2.png) [@v.krishna](https://community.thunkable.com/u/v.krishna)\
**Post date:** [December 28, 2020, 8:17am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/10 "2020-12-28T08:17:13Z")

</div>

and what if the condition is true? will the while loop fire once or till it was false

> [@tatiang](#):
>
> a _repeat while_ loop that starts out with the condition false will fire **zero** times whereas a repeat until loop that starts out with the condition false will fire **one** time.

---

<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:** [December 28, 2020, 8:25am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/11 "2020-12-28T08:25:57Z")

</div>

Honestly, the best thing to do is to test it. It should be pretty easy to determine how those loops work.

---

<div class="post-metadata">

**Author:** ![v.krishna](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/v.krishna/32/84811_2.png) [@v.krishna](https://community.thunkable.com/u/v.krishna)\
**Post date:** [December 28, 2020, 8:26am UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/12 "2020-12-28T08:26:32Z")

</div>

Yep, I will try that thing

---

<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:19pm UTC](https://community.thunkable.com/t/different-between-while-and-until/1041834/13 "2024-11-08T12:19:24Z")

</div>


