Or...
You can use the time out to check your array string.
Code:
serin2 rx,baud,5000,main,[WAIT("REC UNREAD"),SKIP 3,STR num\13,SKIP 27,STR sms\14]
From the above code, if you don't receive the whole string (14 characters) then at timeout, program will jump to label main, here you can check your array sms
Code:
main:
A0=0
for B0=0 to 13
if sms[B0]>0 then A0=A0+1
next B0
If A0 >0 then goto decode
If variable A0 is found >0 then your array has been loaded and program jump to label Decode where you will decode sms array from sms[0] to sms[A0-1].
Is there any way I can make this code work if it receives from 1 to upto 14 characters.
Once in routine Decode,A0 can be anything from 1 to 14 just what you where searching for.
Naturally, before to go to Serin2 you must clear (set to zero) the array sms.
Al.
Bookmarks