In SX Microcontrollers, SX/B Compiler and SX-Key Tool, joegrand wrote: Hi everyone- I'm working on some parsing routines in SX/B and have run into a problem that I've been pulling my hair out for most of the day. This is my first experience programming with SX/B and I've been making some pretty good progress until this issue. I'm using SX-Key v3.10 and SXB 1.42.01. Here is the relevant, problematic code: [code] rcvBuf VAR Byte(8) tmpWord VAR Byte(2) tmpWord = 0 FOR idx1 = 0 TO 6 IF rcvBuf(idx1) <> "." THEN rcvBuf(idx1) = rcvBuf(idx1) - "0" tmpWord = tmpWord * 10 tmpWord = tmpWord + rcvBuf(idx1) ENDIF NEXT [/code] The code should take a string like "00033.4" and convert it to two bytes: $014E (which is 334 in decimal). I'm getting the following error: Error 16, Pass 1, UNKNOWN COMMAND: "LET" If I change tmpWord to a single Byte, the program will compile fine, but will overflow the variable for any string longer than "00025.5". Is SXB not designed to handle words (16-bit) variables or am I just doing something else wrong? Actually, the program SHOULD be using three bytes to handle any string up to "99999.9", but I'm having enough trouble with 2 bytes at the moment. Any help would be appreciated! :) Joe ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=108690 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)