ECK01 RAW: 1220,659,0
TEST: ¨ƒì ¨ƒì ƒì

raw		VAR	BYTE
idx		VAR	BYTE
char		VAR	BYTE
pntr		VAR	NIB
wx		VAR	WORD
wy		VAR	WORD
wz		VAR	WORD

PAUSE 1000
SEROUT RX, T38K4, ["go",CR]
SERIN TX, T38K4, 3000, NO_DATA, [STR raw\17\CR]
DEBUG "RAW: ",STR raw,CR

FOR idx=0 TO 17 : PUT idx, 0 : NEXT  ' zero the spram buffer
PAUSE 1000
SEROUT RX, T38K4, ["R",CR]                    ' I have to use 38.4k. Data is coming from a 3rd party product.
SERIN TX, T38K4, 3000, timeout, [SPSTR 17]    ' <<<< alternative using SPSTR
  timeout:  ' will have to come here via timeout if less than 17 chars received, okay.
GOSUB PARSE

DEBUG "TEST: ", STR wx, " ", STR wy, " ", STR wz, CR

PARSE:
	wx=0 : wy=0 : wz=0
	pntr=0     ' this will point in succession to wx, wy, wz
	FOR idx=0 TO 17
	GET idx,char
	SELECT char
	CASE 0, CR
	EXIT
	CASE "0" TO "9"
	wx(pntr) = wx(pntr)*10+char-48  ' accumulate digits into variable
	CASE ","
	pntr=pntr + 1   ' point to next word wy, wz.
	ENDSELECT
	NEXT
	RETURN  ' wx, wy wz contain values