# making xojo do a count

**URL:** <https://forum.xojo.com/t/making-xojo-do-a-count/39795>\
**Category:** Getting Started\
**Created:** [September 20, 2017, 9:19pm UTC](https://forum.xojo.com/t/making-xojo-do-a-count/39795 "2017-09-20T21:19:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Kidd](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@Brian\_Kidd](https://forum.xojo.com/u/Brian_Kidd)\
**Post date:** [September 20, 2017, 9:19pm UTC](https://forum.xojo.com/t/making-xojo-do-a-count/39795/1 "2017-09-20T21:19:11Z")

</div>

Hi all.  
I am wondering if there is a way to make xojo do a count from a pre-determined amount? For example; "I was in the military and we used to do 3 count pushups, “1 ,2, 3 = 1 pushup” and then keep looping till the pre-determined amount is reached?

Thanks,  
Brian

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [September 20, 2017, 9:34pm UTC](https://forum.xojo.com/t/making-xojo-do-a-count/39795/2 "2017-09-20T21:34:38Z")

</div>

Yes, of course you can use nested loops to achieve counting systems, but you haven’t exactly given us any kind of way to help you.

```auto
dim iDesiredPushups as Integer = 5
dim iDesiredCount as Integer = 3

for iPushup as Integer = 1 to iDesiredPushups
  for iCount as Integer = 1 to iDesiredCount
    MsgBox("Count " + str(iCount))
  next
  
  MsgBox("Pushup " + str(iPushup))
next
```

That’ll give you a million message boxes, and is pretty much exactly what you asked for. If you provide the actual use-case scenario the community might be able to help more.

---

<div class="post-metadata">

**Author:** ![Scott\_Griffitts](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/43a26b/32.png) [@Scott\_Griffitts](https://forum.xojo.com/u/Scott_Griffitts)\
**Post date:** [September 20, 2017, 9:35pm UTC](https://forum.xojo.com/t/making-xojo-do-a-count/39795/3 "2017-09-20T21:35:27Z")

</div>

Do you need the pushup total during the count? If not, just divide the total count by three.

If you need the running pushup total during the count, one way would be:

[code]dim action\_count, pushup\_count as integer

for action\_count = 1 to 100

if action\_count mod 3 = 0 then  
pushup\_count = pushup\_count + 1  
end if

next[/code]

---

<div class="post-metadata">

**Author:** ![Brian\_Kidd](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@Brian\_Kidd](https://forum.xojo.com/u/Brian_Kidd)\
**Post date:** [September 21, 2017, 6:53am UTC](https://forum.xojo.com/t/making-xojo-do-a-count/39795/4 "2017-09-21T06:53:04Z")

</div>

I’ll have to put together some snap shots.

---

<div class="post-metadata">

**Author:** ![Brian\_Kidd](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@Brian\_Kidd](https://forum.xojo.com/u/Brian_Kidd)\
**Post date:** [September 23, 2017, 12:36am UTC](https://forum.xojo.com/t/making-xojo-do-a-count/39795/5 "2017-09-23T00:36:16Z")

</div>

Instead of doing snap shots. I have a video of what is trying to be accomplished. I have most of the math work done for the software.

[5part 4bight turks head video](https://youtu.be/PZLZTlAvSiM) on how to code the knot. By my colleague Mike Hickey.

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [September 23, 2017, 1:08am UTC](https://forum.xojo.com/t/making-xojo-do-a-count/39795/6 "2017-09-23T01:08:30Z")

</div>

Confused… that video laid out all the math… it looked like simple add, subtract, multiple, and modal division…  
Granted, it looked like it might be a bit for work to get the right equations in the right order, but it also looked like it requires the “developer” to be somewhat knowledgable about performing those tasks to create those Knots already…

---

<div class="post-metadata">

**Author:** ![Brian\_Kidd](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@Brian\_Kidd](https://forum.xojo.com/u/Brian_Kidd)\
**Post date:** [September 23, 2017, 7:35am UTC](https://forum.xojo.com/t/making-xojo-do-a-count/39795/7 "2017-09-23T07:35:36Z")

</div>

Correct Dave. I am a braider/knot tier.

---

<div class="post-metadata">

**Author:** ![Brian\_Kidd](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@Brian\_Kidd](https://forum.xojo.com/u/Brian_Kidd)\
**Post date:** [September 24, 2017, 10:50pm UTC](https://forum.xojo.com/t/making-xojo-do-a-count/39795/8 "2017-09-24T22:50:25Z")

</div>

Tim Parnell ;

[quote=351383:@Brian Kidd]Instead of doing snap shots. I have a video of what is trying to be accomplished. I have most of the math work done for the software.

[5part 4bight turks head video](https://youtu.be/PZLZTlAvSiM) on how to code the knot. By my colleague Mike Hickey.[/quote]

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:55pm UTC](https://forum.xojo.com/t/making-xojo-do-a-count/39795/9 "2020-10-29T18:55:39Z")

</div>


