hi i need help to receive the data as a string then parse it.
im new to programming so please help me..


1. if i enter like HSEROUT ["AG 0",13] the cmucam4 will return either ACK\r or NCK\r
Code:
Dim B1 As Byte
test_ag:
HSerOut ["ag 0",13]
HSerIn [B1]
'if the data received is NCK\r it will repeat test_ag:
'while if its ACK\r it will move to the next part of the code
'or if possible to detect only ACK or NCK without the \r


2. if i enter HSEROUT ["TC",13] it will return
NCK\r
or
ACK\r
T mx my x1 y1 x2 y2 pixels confidence\r



dont know how it would look like
Code:
Dim B2 As Byte
Dim tc_mx As Byte
Dim tc_my As Byte
Dim tc_x1 As Byte
Dim tc_y1 As Byte
Dim tc_x2 As Byte
Dim tc_y2 As Byte
Dim tc_p0 As Byte
Dim tc_c0 As Byte 
main:
HSerOut ["TC",13]
HSerIn [B2]
'if the data received is NCK\r it will repeat main:
'while i need to save the values of mx my pixels and confidence.
'mx to tc_mx
'my to tc_my
'pixels to p0
'confidence to c0
'all data recieved are numbers like this:

ACK\r
T 79 59 0 0 159 119 255 255\r