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

Login:
Pass:
 
 

Topic:
Is it possible to retrieve the Prontoscript line number ?
This thread has 7 replies. Displaying all posts.
Post 1 made on Saturday February 21, 2009 at 14:20
Rusty Fobe
Long Time Member
Joined:
Posts:
December 2008
47
I wonder if it is possible to get the statement line number from the prontoscript compiler.

Background:
I'm writing a debugger function that should replace the way I use System.print for debugging. Having to write something like:

System.print("thisVariable="+thisVariable+" "+thatVariable="+thatVariable)

several times becomes boring (well, at least if you make as many programming mistakes as I do ;-). In its simplest form I want to write trace(["thisVariable","thatVariable"]) or something likewise and get the same results. Fairly easy to obtain with eval. Actually that part of the function is already working.

In that function I would also like to get the possibility to print the line number, next to the message, or maybe just the line number. This would offer the possibility to trace the different branches a function should perform, without having to look each time in the bytecode tracing (which unfortunately repeats line numbers many times in its current state). Fullproof branch testing is one of the most difficult aspects of programming. Its easy to forget testing one of the branches.

If anyone is interested, I will make the trace function available as a utility for public use as soon as I get it working properly... with or without line number.

Regards, Rusty
Post 2 made on Saturday February 21, 2009 at 14:34
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
U can usually not get this information becasue the entire activity/page/button script is compiled as a single unit vs line by line. Furthermore, if you use eval() to evaluate panel labels, this is done as a whole as well.

that is why things such as JSLint come in really handy as they are external tools that process files line by line just as the JS compiler would.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 3 made on Saturday February 21, 2009 at 14:54
Rusty Fobe
Long Time Member
Joined:
Posts:
December 2008
47
A bit unfortunate, but ok, I will have to live with it. JSLint is indeed interesting. I used it to check my application. Unfortunately it does not show the line numbers in or next to the input window.
By the way, I like Douglas Crockford's book Javascript, The Good Parts. I had no luck yet getting Flanagan.
Post 4 made on Saturday February 21, 2009 at 15:22
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
Take a look at the Antechinus editor from C Point pty ltd. It shows line numbers, checks syntax, shows color and even has goto line number.

Lyndel favors JSLint, I favor Antechinus. Antechinus is about $50. I think we both use it with my XML debugging tool to make life easier. The XML debugger works with whatever editor you have set as the application for the extension js.
Post 5 made on Saturday February 21, 2009 at 16:14
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
On February 21, 2009 at 14:20, Rusty Fobe said...
I wonder if it is possible to get the statement line number from the prontoscript compiler.

Barry, in case you missed the last 2 words of the original question...

Rusty wants the line # from the compiler on the remote, not from dev time. My suggestion for using JSLint was not an end-all be all as out of the box, it does not check object field name name syntax. So, for that JSLint is rather useless as I typically create classes and use member fields vs using vars.

For example:

function MyClass()
{
this.myField = 'Hello';
};
MyClass.prototype.func = function()
{
var extra = " world!";
System.print(this.myField + extra);
}

var myClass = new MyClass();
myClass.func();

In this case you have object member fields and only use var inside a function. In my case, this is not typically the source of errors, it is fat-fingering the member field name such as "this.myfield" and requires debugging.

Does your tool catch this sort of error? If it does, it might be worth me investigating because it then supports JS "pseudo-classes" and might save me some time.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 6 made on Saturday February 21, 2009 at 16:19
Rusty Fobe
Long Time Member
Joined:
Posts:
December 2008
47
Thanks Barry, I had already a look at Antechinus but did not buy it yet. You mention "your XML debugging tool". Where can I take a look at that?
Post 7 made on Saturday February 21, 2009 at 17:54
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
Lyndel, I do not believe the Atechnis tool catches those. I wish there was some way it would catch or at least flag name case errors as that is my biggest misfingering issue.

Rusty. Go to my web site www.the-gordons.net. Bottom of main page and follow obvious links. What you want is the Pronto Pro development enviroment.
Post 8 made on Saturday February 21, 2009 at 22:58
buzz
Super Member
Joined:
Posts:
May 2003
4,377
You'll need to brew up a few dummy functions, methods, and classes, but the JavaScript debugging tools in the Mozilla browsers (Firefox, et al) can be useful. It is relatively easy to find misSpeLled identifiers.


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

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.

Hosting Services by ipHouse