How to show "Line Number" in the scripting window?

Hi,

Is there a way to show the “Line Number” in the Script window? debugging an error would be easier if we have the line number.
Thanks in advance,

Jahan

http://docs.testplant.com/?q=content/scripts-pane-and-script-editor

Testplant told us there is no way to display the line numbers in the editor, but item #8 on the page above should help.

Showing line numbers in the script wouldn’t really provide any functionality that isn’t already available.

The main thing to point out is that there is a field at the top of the script editor that always shows you what line of the handler (more on that in a moment) you are on. The other function that this field has is to take you to a specific line. Just enter the line number that you want to go to into the field and hit return, and eggPlant will scroll to that location in the script with the line highlighted. So you always know what line you are on and can get to any other line, which is really the only functionality provided by line numbers. They don’t have any other purpose in eggPlant scripting.

When your script fails, there is a “Show Script” button. Clicking that button takes you to the script with the line that failed highlighted, no number required.

As I hinted at above, line numbers start over at 1 in each handler in a script. If you have a script with some bare code at the top and 5 handlers defined at the bottom, you will have 6 line #1s in the script file. So for the field to take you to the specified line in a handler, you would need to start with the cursor in a line in that handler.

One way in which line numbers would be helpful, particularly if they used a standard numbering convention and not the ‘handler resets to 1’ convention, is when providing assistance to other people who are writing scripts. If I am performing code review for another analyst, it is much easier for me to say “let’s look at your code on line 24” than “switch your handler to mycoolhandler and then use your jump button to navigate there.” The current workaround is to open the script file in an external application such as Notepad++ and provide support from there.

The use-case you describe (helping someone else) is not common; I’ve never seen anyone use that as an argument for line numbers before (17 years of supporting Functional). And “Standard number convention” doesn’t reflect what is actually happening with the handlers. The compiler doesn’t see handlers as part of a script file, so it can’t report back the line number from the start of the file. It wasn’t an arbitrary decision.