Your code should work as described.

Well ... barring other problems like ... Analog mode or CONFIGs.

Possibly ...

Presetting Configuration Fuses (PIC Defines) into your Program
http://www.picbasic.co.uk/forum/showthread.php?t=543

Another good thread ...

PortA Doesn't Work
http://www.picbasic.co.uk/forum/showthread.php?t=561
<br>