Re: boring ole modem stuff

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu