Did you declare X VAR BYTE? Should work fine otherwise. What error do you get?