NetTalk Central

Author Topic: NetClient - How to stop reading  (Read 11950 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
NetClient - How to stop reading
« 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
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetClient - How to stop reading
« Reply #1 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

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetClient - How to stop reading
« Reply #2 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
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetClient - How to stop reading
« Reply #3 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



Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: NetClient - How to stop reading
« Reply #4 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
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NetClient - How to stop reading
« Reply #5 on: August 15, 2011, 05:16:30 AM »
yes.