Thank you Darrel. I thought
IF PORTB.0 = 0 Then FlagBit = 1 : Return
was the same as
IF PORTB.0 = 0 Then FlagBit = 1
Return
If it is the same, isn't it going to RETURN regardless of PORTB.0 or Flagbit? Does the first statement RETURN only when PORTB.0 = 0? Thank you. -Peter


DOSOMETHING:
IF PORTB.2 = 1 Then Return
IF PORTA.5 = 0 Then Return
IF PORTB.0 = 0 Then FlagBit = 1 : Return
GoTo DOSOMETHING 'STAY HERE UNTIL RB2, RA5 OR RB0 DOES SOMETHING