Welcome to the forum.

The PIC you are using has analog on PORTA. You will need to make it digital.
Add this near the top of your code
Code:
ANSEL=%00000000
CMCON=%00000111
And this thread will be some good reading
http://www.picbasic.co.uk/forum/showthread.php?t=561