Re: boring ole modem stuff
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Feb 02, 2006
- 425 views
On Wed, 01 Feb 2006 18:42:21 -0800, Some Slacker <guest at RapidEuphoria.com> wrote: >I'm tryin to get the caller id info from the modem I don't know anything about modems, but...
> if length(s)>10 then > for i = 1 to length(s)-10 do > if s[i]=10 and s[i+1]=13 and s[i+2]=10 > and s[i+3]=82 and s[i+4]=73 and s[i+5]=78 > and s[i+6]=71 and s[i+7]=13 and s[i+8]=10 > and s[i+9]=13 and s[i+10]=10 then > RING=1 > s=s[i+11..$] > end if > end for > end if
I think can be replaced by:
integer k k = match("\n\r\nRING\r\n\r\n",s) if k then RING = 1 s = s[k+11..$] end if
Regards, Pete