Thanks for that Darrel, works a treat although I am still not quite sure why I need to clear PORTd before using TRIS. It has always seemed to me that there is a real need for a genuine idiot's guide (speaking as a genuine idiot). For instance the PICbasic manual early on gives the usual little blink program but there is no mention of setting up oscillators clearing registers etc. without which it wont work ! Just a thought as I have always felt that mant people are put off learning about a fantastic piece of kit which is a shame as once having got over all these teething troubles the system is a joy to use.
Thanks again
Regards
David Marks