How to make a count loop not loop at all?

This is such a simple question. I tried all possibilities but none of them worked. Doc:

Repeat an action the specified number of times
Count with i from [1] to [10] by [1]

https://x.thunkable.com/copy/c8cc556efd2ca92abd96d8823bc814ab
1, 1, 1 I expected the count loop not to enter but it entered once. When I tried -1 it entered 3 times. First it surprised me then I realized what it was doing. It was decrementing to -1. So if it is 1 to 1 by 1 technically it should not enter the loop at all. I am stuck here. Please help

Your blocks are:

Why are you trying to count from 1 to 1? That loop will happen one time. If you are trying negative numbers, please post a screenshot of those blocks.

Thanks for getting back to me. My question is I don’t want it to loop even once.
image
In this case if #j = 1 I dont want the inner count #i loop making any loops. It should get bypassed. For #j = 2 and above do the loop. Ofcourse I can put a if block and solve the issue. However I want to avoid putting the if block, if count has the capability to skip then that would be ideal. In C++ this is possible.

I understand that you’re wanting to re-create loops from C++. I’m maybe not the best person to help you with this because I don’t do a lot of coding outside of Thunkable. I do understand a basic C++ loop. I just don’t have a lot of experience implementing them.

But I’m curious… is this for a sort or recursion of some other method that requires a loop from 1 to 1 by 1 to not fire at all?

is this for a sort or recursion of some other method that requires a loop from 1 to 1 by 1 to not fire at all?
No, no, let me clarify. There are two points here

  1. There is the “from” and the “by”. If I were keep both of them as 1 what value would you put in “to” so that the second loop does not fire?
  2. As you can see it is two nested loops. So for the very first value of #j, I dont want the second loop to fire. For all the other value of #j I want it to fire.

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