The easy way to find out what is going on is to look at the .LST file in the same directory as the .BAS file. Open this .LST file and search for the word "WARNING". You should see somewhere in the area the variable that is being manipulated. This warning is often given if someone is trying to manipulate data as if it is a WORD, but indead the variable is a BYTE.
Bookmarks