NetTalk Central

The Rest Of NetTalk => The Rest - Ask For Help => Topic started by: Alberto on July 22, 2011, 07:17:50 AM

Title: NetClient - How to stop reading
Post by: Alberto on July 22, 2011, 07:17:50 AM
I{m reading pages in text only mode and need to stop reading when some word is red.
I´m codign this in Proces ember

if FinishIfRead <> '' and instring(clip(FinishIfRead),PageString,1,1)<>0
    self.close
END

PageString is empty till it finished reading.
What poperty must I use instead?

Thanks
Title: Re: NetClient - How to stop reading
Post by: Bruce on July 22, 2011, 08:38:53 PM
Hi Alberto,
Do you mean the NetWebClient class?
That's different to NetClient, but seems to make more sense.
yes?

cheers
Bruce
Title: Re: NetClient - How to stop reading
Post by: Alberto on August 12, 2011, 12:51:30 PM
Yes Bruce, NetWebClient.

Problem is when I use that code the app stops reading until a random number of process runs.

Is the code ok?

I´m coding this in Process embed:

if loc:FinishIfRead <> ''  and  instring(clip(loc:FinishIfRead),self.Page,1,1)<>0
    self.close
END
Title: Re: NetClient - How to stop reading
Post by: Bruce on August 14, 2011, 09:58:32 PM
Hi Alberto,

When you do a "Fetch" or "Post" the result ends up in the .PageReceived method.
If the page is very large, and arrives as multiple packets, then the .Process method is called for each incoming packet.

So it sounds to me like you want to intercept it in .Process rather than .PageReceived.
The incoming data is in self.packet.bindata

Be aware though that the packet could be split "inside" the text you are looking for.

cheers
Bruce


Title: Re: NetClient - How to stop reading
Post by: Alberto on August 15, 2011, 03:39:56 AM
Ok, I´m usiong the .Proceess to check the incomming data.
It is ok to use self.close to end up the reading from the .Processs method?
Thanks
Title: Re: NetClient - How to stop reading
Post by: Bruce on August 15, 2011, 05:16:30 AM
yes.