Perhaps this could be useful?

http://www.picbasic.co.uk/forum/show...=&threadid=631