cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
john_madden
Level VI

Get currently executing line number of script as a variable

I'd like to send progress messages to the log that include the currently executing line number of the script. If I never changed the script of course I could just hard-code the line number into the message. But when I add/delete lines in the course of editing, the line numbers change. So is there a function that gives you the currently executing line number, so I could incorporate something like

Write("The script has now progressed to line number ", CurrentlyExecutingLine())
1 ACCEPTED SOLUTION

Accepted Solutions
mmarchandTSI
Level V

Re: Get currently executing line number of script as a variable

It doesn't appear this is an option, but perhaps this workaround will do the trick for you.  Put the entire text of the script into a variable at the beginning of the script.  First line could be something like

script_text = Load Text File( "Path\script.jsl" );

Then, whenever you want to tell the user what line is executing,

//marker001
Write( "The script has now progressed to line number ", Contains( Words( script_text, "\!N" ), "//marker001" ) + 1 );

 Just make sure "//marker###" is the only text on its line.

View solution in original post

2 REPLIES 2
mmarchandTSI
Level V

Re: Get currently executing line number of script as a variable

It doesn't appear this is an option, but perhaps this workaround will do the trick for you.  Put the entire text of the script into a variable at the beginning of the script.  First line could be something like

script_text = Load Text File( "Path\script.jsl" );

Then, whenever you want to tell the user what line is executing,

//marker001
Write( "The script has now progressed to line number ", Contains( Words( script_text, "\!N" ), "//marker001" ) + 1 );

 Just make sure "//marker###" is the only text on its line.

john_madden
Level VI

Re: Get currently executing line number of script as a variable

Thanks. You'll admit, I'm sure, that it's kluge-y. But it's definitely clever!

Recommended Articles