Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 18 made on Wednesday September 22, 2010 at 13:58
bnokes@AAVViD
Long Time Member
Joined:
Posts:
June 2009
31
On September 15, 2010 at 20:54, Lyndel McGee said...
\r (just like in C/C++) is Carriage Return.

You need to remove the extra space in " " such that your command looks like:

label = s.match("", "\r", 2000);

What this line does is wait up to 2 seconds to receive a line of text from the serial port. The empty string (same as null) in the first parameter sends nothing and therefore this match operation only does receive with timeout of 2 seconds. I highly recommend reading Appendix A or B of the Dev Guide that discusses each of these functions based on the ProntoScript object type. If it is not in an appendix, there should be a dedicated section in the guide for these. I can't recall if they removed the appendix in the latest dev guide but it was there in previous releases and was invaluable.

Assuming that you get a string (the extender saw a string ending in \r within 2 seconds), the variable label will contain the string received provided that you have not assigned an onData and onTimeout functions (asynchronous serial port usage).

I also have developer-guide-1.3.9.pdf Version 1.3.9 and DevelopersGuide_ProntoScript_Jan08 Version 1.1

yes i remember reading about this some what and trying to understand, but I also have seen other code that takes me back and would like to know why they are doing this one way some one else another way. Let me find some examples i'll get back to you.


Hosting Services by ipHouse