i ended up with a while loop, but il try the for loop.

Thx for the help. Il be coming back, waiting for a gps module it should be here in a couple of days
Code:
    i = 1
    while i<40
        pulsout PORTC.1,pos
        i=i+1
        pause 20
    wend
the for loop gave me and syntax error