... I need to use the 'interrupt-on-change' capability of the 18F to detect (and hopefully count) the decoded clock output from a rotary encoder.
Try this one from SteveB ...

http://www.picbasic.co.uk/forum/show...5396#post25396

There were some changes to it, so read the rest of the thread too.

hth,