Hi Dave,
I think your latest solution might have worked, but I had already got it working by parsing it after the fact based on Jersons parse routine. I really appreciate everyones input. Here is what the working code looks like:
hserIN 65535, oops, [STR inputdata\12\10] 'get the serial data
gosub ParseNumber 'split the raw data into 2 numbers
ParseNumber: ' collect both pieces of the data in sep arrays
for Cntr = 0 to 10
if inputdata[Cntr] <> "," then ' Found comma? We've got first
smallp[Cntr] = inputdata[Cntr]
else
Cntr2 = Cntr 'marks where the comma was
'goto earlyexit
goto GetNum2 ' Now get the second number
endif
next
earlyexit:
return
GetNum2:
CNTR = Cntr + 1 'get past the comma
for Cntr = Cntr to 10
if inputdata[Cntr] < "0" then
RETURN
else
If inputdata[Cntr] > "9" then
RETURN
ELSE
largep[Cntr-Cntr2-1] = inputdata[Cntr] ' It's a valid number
endif
ENDIF
next
return
I had to modify the array pointer for the second number by subtracting the point at which the comma was found on the first pass from it's pointer. In other words the pointer for the input data can't be used directly to point to the second number.
Bookmarks