I'm trying to get the hang of PIC programming, so I made a really simple circuit with two leds on port 1 and 2, and a switch on port 0 (connected so that pin 0 is high when the switch is open. The pin is connected to the positive terminal via a 10k resistor, and to ground via the switch).

The code segment I use is:
c VAR BYTE
...
c = PORTA
IF c.0 = 0 Then loop2

What have I done wrong? I have also tried the button command, and using pin 4 instead, still not working. Please help me!

Thanks
/Henrik