# What is the problem in these blocks

**URL:** https://community.thunkable.com/t/what-is-the-problem-in-these-blocks/196436
**Category:** Questions about Thunkable X
**Created:** [August 25, 2019, 4:19pm UTC](https://community.thunkable.com/t/what-is-the-problem-in-these-blocks/196436 "2019-08-25T16:19:51Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [August 25, 2019, 4:19pm UTC](https://community.thunkable.com/t/what-is-the-problem-in-these-blocks/196436/1 "2019-08-25T16:19:51Z")

</div>

Everytime I use these “counting” metode to get rows out of the DB something gets crazy. Look at the down left corner in the video. The counting should only go to 8 with the repeat 8 times. What do I do wrong???

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

[https://dl.dropboxusercontent.com/s/icsh74amldw81pz/thunkable1.MP4?dl=0&fbclid=IwAR372hz7EieYFGrlaxkACCLVHF4pS8PgfANwBOhPZo7Ug6r-RvDkBJdcf6w](https://dl.dropboxusercontent.com/s/icsh74amldw81pz/thunkable1.MP4?dl=0&fbclid=IwAR372hz7EieYFGrlaxkACCLVHF4pS8PgfANwBOhPZo7Ug6r-RvDkBJdcf6w)

---

<div class="post-metadata">

### Author: ![Daniel\_Coglitore](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Daniel\_Coglitore](https://community.thunkable.com/u/Daniel_Coglitore)
#### Post date: [August 25, 2019, 6:13pm UTC](https://community.thunkable.com/t/what-is-the-problem-in-these-blocks/196436/2 "2019-08-25T18:13:33Z")

</div>

I can’t see the video , maybe upload again?

---

<div class="post-metadata">

### Author: ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)
#### Post date: [August 25, 2019, 6:34pm UTC](https://community.thunkable.com/t/what-is-the-problem-in-these-blocks/196436/3 "2019-08-25T18:34:21Z")

</div>

Given that the video does not work, perhaps you can describe the behavior you get?

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [August 25, 2019, 7:02pm UTC](https://community.thunkable.com/t/what-is-the-problem-in-these-blocks/196436/4 "2019-08-25T19:02:03Z")

</div>

It is counting to 50 and no break on 1 sec.

---

<div class="post-metadata">

### Author: ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)
#### Post date: [August 25, 2019, 9:21pm UTC](https://community.thunkable.com/t/what-is-the-problem-in-these-blocks/196436/5 "2019-08-25T21:21:06Z")

</div>

Is it possible that you have multiple instances of the “get\_point” function being simultaneously launched?

I see that you have one call to “get\_point” in the unidentified logic block on the right; but that block, what is calling it?

Because you rely on the value of “spiller\_nr” to go from 1 to 8, perhaps using a “count with” block instead of a “repeat”; the “count with” will take care of incrementing the value, will take care of initializing it to 1 and will never push it past the upper limit.

---

<div class="post-metadata">

### Author: ![funhall](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/funhall/32/92145_2.png) [@funhall](https://community.thunkable.com/u/funhall)
#### Post date: [August 26, 2019, 2:41pm UTC](https://community.thunkable.com/t/what-is-the-problem-in-these-blocks/196436/6 "2019-08-26T14:41:13Z")

</div>

You were right. That get\_point was called 8 times from a nother place. So it helped when I moved it. But I like to know a little more about how to use the count with. in this case. I hope you can help me showing som blocks how to make this “count”

---

<div class="post-metadata">

### Author: ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)
#### Post date: [August 26, 2019, 7:05pm UTC](https://community.thunkable.com/t/what-is-the-problem-in-these-blocks/196436/7 "2019-08-26T19:05:30Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/2/72ef55b25ee8a572d98cf5f046da6938533a5754.png)

You simply import all the stuff you presently have in your current get\_point procedure inside the “count with” loop, with the exception of checking or setting the value of “spiller\_nr” since the loop component takes care of that.  
Given that the loop would typically take 8 seconds to run, the procedure may disable the button that calls it right away, and re-enable it after it is finished. That would prevent multiple instances being launched.

---

<div class="post-metadata">

### Author: ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)
#### Post date: [August 26, 2019, 8:34pm UTC](https://community.thunkable.com/t/what-is-the-problem-in-these-blocks/196436/8 "2019-08-26T20:34:23Z")

</div>

@funhall I think that you are running into the problem described (and solved) in [Asynchronous Blocks within Loops](http://community.thunkable.com/t/asynchronous-blocks-within-loops/33524).

-Mark

---

<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:11pm UTC](https://community.thunkable.com/t/what-is-the-problem-in-these-blocks/196436/9 "2024-11-08T12:11:48Z")

</div>


