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 1 made on Saturday July 22, 2017 at 08:38
JohnL28
Long Time Member
Joined:
Posts:
July 2006
40
I am a self-taught Prontoscript programmer who has written thousands of lines of likely poorly written code. I recently started using Visual Studio Code (VSC) for small section of code to help in debugging. It is amazing how much easier it is, when compared to the Prontoscript simulator. When debugged, I then just ‘cut & paste’ sections into ProntoScript libraries and upload to the remote.
There are obvious differences though. As an example, VSC is expecting ‘console.log’ for output, Prontoscript is expecting ‘System.print’. In VSC, I just created an object to handle this so that I do not have to adjust the code as I move between platforms:

function SystemObj() {
this.print = function (String) { console.log(String) };
}
var System = new SystemObj();

This leads to my question. Is there something similar I can do with CF.widget references? For instance, one line of code is as follows:

CF.widget("TV EQUIP").label = "TIVO";

Is there an object I can write that will allow me to ignore the line in VSC instead of generating an error? I have been trying, but I have hit my limits of Javascript understanding. One of my (likely lame) attempts is below:

function CFObj() {
this.widget = function (Equip) {
this.label = Equip;
}
}
CF = new CFObj();


Hosting Services by ipHouse