# making xojo do a count

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

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.

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

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]

I’ll have to put together some snap shots.

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 on how to code the knot. By my colleague Mike Hickey.

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…

Correct Dave. I am a braider/knot tier.

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 on how to code the knot. By my colleague Mike Hickey.[/quote]