I need help keeping track of incoming variables. I am reading bytes over serial and need to store each byte in order in an array or something. I also need to make sure of the start and end so I was thinking of sending about 5 "0" bytes in a row to signify a new set.
ex: 10 bytes
0 0 0 0 0 48 244 31 1 250 132 154 102 88 42

I tried using something like this without any luck.
Code:
var lop = 10;
if(port_read_bytes(hPort,&last_recieved,1) && lop==10)
	{
		lop = 15;
		str_cpy((debug.pstring)[0], "Recieved = ");

		bytez[0] = last_recieved;
		str_cat((debug.pstring)[0], _chr(str_for_int(NULL,(long)bytez[0])));
		wait(10);
	}


then the next one would read into bytez[1] keeping bytez[0] seperate, but it seems to change all my bytez array.

Can anyone help me get this working?
thanks
:-)


Black holes are where God divided by zero.