This is what I understand you may be looking for (not tested yet).
Code:
MAIN:
   IF PORTA.2 = 0 THEN
      PAUSE 300 'debounce
      GOTO Program1:
   ENDIF
   GOTO MAIN:

Program1:
   IF PORTA.2 = 0 THEN
      PAUSE 300
      GOTO Program2:
   ENDIF
   HIGH PORTB.1
   PAUSE 500
   LOW PORTB.1
   PAUSE 500
   GOTO Program1:

Program2:
   IF PORTA.2 = 0 THEN
      PAUSE 300
      GOTO Program3:
   ENDIF
   HIGH PORTB.2
   PAUSE 500
   LOW PORTB.2
   PAUSE 500
   GOTO Program2:

Program3:
   IF PORTA.2 = 0 THEN
      PAUSE 300
      GOTO Program1:
   ENDIF
   HIGH PORTB.3
   PAUSE 500
   LOW PORTB.3
   PAUSE 500
   GOTO Program3:

END
Quote Originally Posted by dragan77
...Can you write finish code for compile, because I am new in programing!
Quote Originally Posted by dragan77
Thanks,for your help,but not working!
Quote Originally Posted by dragan77
But,can,you ex plane me,what I must do, which peace,of your code,I must change...
.....
My question to you dragan77: is this thread really 30 replies worth? What are your personal inputs and efforts?

It looks a bit frustrating to me....