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();