grasshopper
01-10-2009, 10:30 PM
OBJ
Ser : "FullDuplexSerial"
Var
Byte RxDat[30] ' for serial data buffer
Pub Main
Ser.Start(USBRx,USBTx,OFF,19200)
REPEAT
IF (ser.rxcheck == "(")
GetCom
Pub Getcom | stringCount, Scrap, X
Scrap~
StringCount~
Repeat UNTIL (RxDat[ StringCount ] := SER.rx ) == ")"
StringCount ++
Repeat X from 1 to 3
IF (textComp(@rxDat[ 0 ],@RX[ X ],7) == TRUE)
Case X
1 : Ser.str(string("One"))
2 : Ser.str(string("Two"))
3 : Ser.str(string("Three"))
Dat
RX[ 1 ] BYTE "One A11",0
Rx[ 2 ] BYTE "Two B22",0
Rx[ 3 ] BYTE "Three 33",0
My problem is in the Dat section. I cant index through the library of commands. Is there a way to do this?
Ser : "FullDuplexSerial"
Var
Byte RxDat[30] ' for serial data buffer
Pub Main
Ser.Start(USBRx,USBTx,OFF,19200)
REPEAT
IF (ser.rxcheck == "(")
GetCom
Pub Getcom | stringCount, Scrap, X
Scrap~
StringCount~
Repeat UNTIL (RxDat[ StringCount ] := SER.rx ) == ")"
StringCount ++
Repeat X from 1 to 3
IF (textComp(@rxDat[ 0 ],@RX[ X ],7) == TRUE)
Case X
1 : Ser.str(string("One"))
2 : Ser.str(string("Two"))
3 : Ser.str(string("Three"))
Dat
RX[ 1 ] BYTE "One A11",0
Rx[ 2 ] BYTE "Two B22",0
Rx[ 3 ] BYTE "Three 33",0
My problem is in the Dat section. I cant index through the library of commands. Is there a way to do this?