In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote: Jon, No you cannot define word variables. Only arrays. The way around this is to define some global WORD variables, then save their value at the beginning of the subroutine and restore the value at the end of the subroutine. You need to do the same thing to get a "normal" byte variable to use as an array index. tempW VAR WORD ' Global variable SUB MySub saveTempW VAR BYTE (2) 'Save value of tempW saveTempW(0) = tempW_LSB saveTempW(1) = tempW_MSB FOR tempW = 0 TO 1000 NEXT ' Restore value of tempW tempW_LSB = saveTempW(0) tempW_MSB =saveTempW(1) ENDSUB Bean. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=199207#m199342 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)