EDWARD, This is one way to do what you need too:

loop:
if portb.0 <> state then 'reset counter whenever state changes
state = portb.0
cntr = 0
endif
cntr = cntr + 1
if cntr < 2000 then 'set for number of pass thru your output loop

for x = 1 to 10 + D '<----here
PULSOUT portc.2,50 '
next '

pause T '<----to here

else
'do something else
endif

goto loop

HTH,
Dave Purola,
N8NTA