cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP Wish List

We want to hear your ideas for improving JMP software.

  1. Search: Please search for an existing idea first before submitting a new idea.
  2. Submit: Post your new idea using the Suggest an Idea button. Please submit one actionable idea per post rather than a single post with multiple ideas.
  3. Kudo & Comment Kudo ideas you like, and comment to add to an idea.
  4. Subscribe: Follow the status of ideas you like. Refer to status definitions to understand where an idea is in its lifecycle. (You are automatically subscribed to ideas you've submitted or commented on.)

We consider several factors when looking for what ideas to add to JMP. This includes what will have the greatest benefit to our customers based on scope, needs and current resources. Product ideas help us decide what features to work on next. Additionally, we often look to ideas for inspiration on how to add value to developments already in our pipeline or enhancements to new or existing features.

Choose Language Hide Translation Bar

Preserve comments and whitespace in JSL code attached to data table

When I write code, I try to make it easy to read, understand, and maintain.  I write comments.  I indent code blocks.  I use line breaks to spread the code out over multiple lines.  I try to write code with a consistent style.  However, I frequently find that JMP reformats my code without asking.  It simply decides to obliterate all the effort that I put into good coding practices.

 

For example, I write a script and attach it to a data table.  Then I right-click on the script and press "Copy" and then right-click in the script window and press "Paste".  The copy of the script does not contain any of the comments or code block indentions that were in the original script.

 

Another example:  I create a formula column on a data table.  Inside of the formula editor block, I write some JSL code to perform an iterative calculation (this is really cool. I just figured out you could do this!).  Of course I want to use comments and whitespace in this code, like I would in literally any code that I write anywhere.  Well, after I hit enter, the comments are invisible until I double-click on the formula editor block.  But they do exist.  Until I click OK and JMP evaluates the formula.  Next time I open the formula, comments and whitespace are gone.

 

It gets worse.  I have multiple scripts attached to my table that all reference a certain column.  Then I rename that column.  All of these scripts are updated with the new column name.  But in doing so, they are all "reformatted" by the JSL parser and all of my comments and whitespace are destroyed.  ಠ_ಠ

 

What is the point of even having comments in the JSL language if JMP is going to immediately wipe them out at the first opportunity?  Am I supposed to edit my JSL scripts in a less-hostile text editor (i.e. Notepad++) and store the readable versions as separate files?  I just don't understand why it has to be this way.  Please leave my comments alone!

 

Note: @Cwalla reported the same issue in the forums here 

7 Comments
nao
Level IV
I do store well-formatted versions of scripts as text file separately. I hope JMP preserves the format.
bobmorrane
Level V

Hi @Chris_Rodrigues,

 

 

I was just having a discussion on this topic:  How-to-keep-formatting-and-comments-with-New-Script  

My issue does not arise in exactly the same context but the result is the same: when a script add a new script to a data table using the New Script () function, comments and layout are lost.

 

I thought there might be a workaround but to re-insert comments and layout in script within data tables but it looks like this is not the case.

While we wait for your wishlist item to be approved, there are a couple of solutions that one could use :

-Store your scripts in separate files. In your data table, your scripts would just be a link to open the .jsl files. Like this there would be no chance of losing information.

-Store your comments in a custom made comment function that just writes your comments in the log. I know it's not ideal, since you could still lose your layout but at least your comments would be preserved.

 

Let's hope more people Kudo this wish, it looks very necesary !

 

 

 

 

XanGregg
Staff

I added a JSL Quote example to the thread.

 

New Table( "formatted script",
	New Script( "my script",
		Eval( Parse(JSL Quote(
// example
x = 1;

		Print( :column 1[1], y );
		
)			)
		)
	),
	New Column( "Column 1", Set Values( [5] ) )
)


 

 

bobmorrane
Level V

Thanks @XanGregg , this solves my issue

Status changed to: Acknowledged

Hi @Chris_Rodrigues, thank you for your suggestion! We have captured your request and will take it under consideration.

hogi
Level XI

Most of the mentioned issues got fixed in the mean time - and with the reformatting I can live : )

What remains: comments in column formulas.

As JMP is quite open to the voice of the customer, it seems there is a strong argument against it:
comments can't stay in column formulas?
why?

hogi
Level XI

Regarding renaming of column variables in a table script, it's interesting that source scripts are edited as well.

 

By renaming the column in the summary table, the source script get corrupted:

Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dtsum = dt << Summary(
	Group( :sex ),
	Mean( :height ),
	Link to original data table( 0 )
);

dt :sex << Set Name( "sex_2" );