Post 1 made on Saturday July 22, 2017 at 08:38 |
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();
|
|
Post 2 made on Sunday July 23, 2017 at 14:47 |
Lyndel McGee RC Moderator |
Joined: Posts: | August 2001 12,997 |
|
|
This thread will hopefully give you more insight an some examples to get you started. [Link: remotecentral.com]Lyndel
|
Lyndel McGee Philips Pronto Addict/Beta Tester
|
|
Post 3 made on Thursday November 9, 2017 at 15:38 |
Barry Gordon Founding Member |
Joined: Posts: | August 2001 2,157 |
|
|
I do all my development for my RPi in Visual Studio. The RPi is a linux machine, Visual Studio is a windows machine. In the code I have a use the sequence
if (process.platform == "win32") { "; } else { };
That might work for you
|
|
Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our
Marketplace. For information on how to advertise your service or product
click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.