Ok, so this is where I got, not far.

I tried everthing and more but still no joy, waisted a lot of peoples time and ended up back to square one sorry and thanks for your help.

I feel there is a problem with these PICs or my epic is failing to store the code in the chip, I tried all night going over and over it then threw the towel in and gave up. I think the only sollution I have is to just use pic16f877-20/p which work fine instead of the pic16f877a i/p which give me problems.

working back using the pic16f877-20/p I have a new problem with ports http://www.picbasic.co.uk/forum/showthread.php?t=1683 any idea's guys