cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Cwalla
Level II

JSL scripts - comments and blank space disappear after running/pasting

Hello All,

 

I have a fairly long JSL script (~500 lines). It collects user input and then creates graphs from the table of data the script is in.

 

I have been encountering a bizarre problem however. Sometimes after running the script using the green arrow in the script window (not the "run" button with the editor open), when I open the script back up all the comments and blank spaces I had in the script are gone. This does not occur when I run the script with the "run" button from the editor.

 

I don't understand if this is because the script is too long and JMP is trying to condense it/reformat it, but I want to keep the comments. The script still works in this reformatted form but it is extremely confusing to look at.

 

The script has only recently started doing this, and it seems to be strongly linked to the length in my opinion, but I may be missing something.

 

My only other lead/info is that when a command in the script fails, that almost always will then cause the script to lose its comments/whitespace. I.E. if I create a graph with the variable (:Batch #) but there is no column named "Batch #" that will cause the script to lose its comments/whitespace

 

Has anyone experienced this,or know what might be causing it?

 

Thanks!

 

 

 

This same behavior happens when I try to directly copy the script from one data table to another; as it is I have to manually copy the text and paste that.

1 ACCEPTED SOLUTION

Accepted Solutions
Cwalla
Level II

Re: JSL scripts - comments and blank space disappear after running/pasting

Hello All,

 

I figured out the issue. When you change the name of a column, or JMP tries to access a column that doesn't exist via script, all the scripts in the data table will be evaluated and reformatted. I.E., if I have a command that says plot(:name("time")), that would be evaluated to plot(:time).

 

Annoyingly in my opinion, this will change if i rename the column "time". If I change the name of "time" to "Times" it will update the script as well. The plot command will now be plot(:times) so that it is still referencing the original column even when it has been renamed.

 

This can definitely be a good thing at times for the specific application I have it stops progress.

 

Just wanted to share so if anyone sees this they know what the issue was.

View solution in original post

3 REPLIES 3
Cwalla
Level II

Re: JSL scripts - comments and blank space disappear after running/pasting

I have some updates on what I have observed;

 

1. The script only is reformatted and losses its comments/blank space when an error occurs, and only if it was run without the editor open. The script won't be reformatted while the editor is open.

2. If no errors occur the script will run as expected with no reformatting, regardless of how it was run or if the editor is open

3. The reformatted script basically looks like the version that appears in the debugger window, with a few symbols different

 

Not sure if this will help but the more information the better in my opinion!

Cwalla
Level II

Re: JSL scripts - comments and blank space disappear after running/pasting

Hello All,

 

I figured out the issue. When you change the name of a column, or JMP tries to access a column that doesn't exist via script, all the scripts in the data table will be evaluated and reformatted. I.E., if I have a command that says plot(:name("time")), that would be evaluated to plot(:time).

 

Annoyingly in my opinion, this will change if i rename the column "time". If I change the name of "time" to "Times" it will update the script as well. The plot command will now be plot(:times) so that it is still referencing the original column even when it has been renamed.

 

This can definitely be a good thing at times for the specific application I have it stops progress.

 

Just wanted to share so if anyone sees this they know what the issue was.

Craige_Hales
Super User

Re: JSL scripts - comments and blank space disappear after running/pasting

Thanks for tracking that down! I'll enter a report for it.

Craige