PDA

View Full Version : Counted Loops



BenJ
27-01-2006, 21:08
How do you loop a set of data a ceratian amount of times and then go to another set of data, so you don't have to duplicate any data e.g.

main:
high 0
high 1
pause 500
low 0
low 1
pause 500

- then i would want it to loop that for say, 4 times then go onto something differen?

Please help!!!!

Fowkc
27-01-2006, 21:51
It's quite simple. Set a For...Next loop up using a variable you don't need:

FOR b0 = 1 TO 4
high 0
high 1
pause 500
low 0
low 1
pause 500
NEXT b0

This code would run through 4 times and trhen continue to the next line.

BenJ
28-01-2006, 19:30
Thanks Fowkc, it was simple but very much apreciated!!!!!!!!!