Maybe this will help. Scroll down to post #125 to start.
http://www.picbasic.co.uk/forum/show...t=12677&page=4

In your code, where does the value of "m" come from?

And... Look at using code tags when you post code. Makes it easier to read...
http://www.picbasic.co.uk/forum/misc.php?do=bbcode#code