Different between while and until

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

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,


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,

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!

3 Likes

thanks but they look like same

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

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

i really need clear explanation

becoz I am making a business app

@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.

2 Likes

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

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

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

Yep, I will try that thing