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 6 made on Saturday August 18, 2007 at 02:48
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,996
On August 17, 2007 at 08:02, André du Fresne said...
| Why all this try, catch, diagnostics? I don't
understand it - all I want is to have this.process()
looped, but I couldn't get it to work.

The try/catch is put in place to facilitate catching errors in your script, logging them and not letting them propagate out into the Pronto Code. This becomes increasingly important when doing TCP socket or RS-232 programming and using asynchronous onData notifications. If you let an error propagate out of your own script, especially in TCP, Pronto will likely close and tear down the socket.

General programming philosophy (aka best practice) is. If your code generates errors, catch and handle/log them and don't let the propagate out into code that you don't own nor do you know how it behaves when an unexpected error is introduced.
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse