cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • DownloadSemiconductor Toolkit: Tools to create wafer maps, add wafer geometry to graphics, explore die defects & compare wafers.
  • Discovery Summit 2026: Early User Edition - September 23-24.Register. It's free.
  • Use JMP Clinical with CDISC-compliant data. Review studies, ID safety and efficacy signals & communicate findings with interactive graphics. Register to see how. Aug. 27, 2 pm US ET.

Discussions

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

How to keep formatting and comments with New Script () ?

Hello everyone,

 

it's me again. Another day, another question :)

So I made a nice long script that creates a new data table which contains some scripts. I use the New Script () function to do this.

dt<< New script ("myscript",

// comments
//beautiful indentation
   (
       (
        (  (  instructions) )
         )
      )
 ) 

);

 

My issue is that when I check the script Inside the table dt, all comments are lost, as well as the layout, my personal style of indentation, empty lines, etc.

These scripts are intended for users who are not necesarily familiar with JSL, so I need to keep the comments and the original layout.

 

I was trying to do something like putting my scripts in a string and using Append() or Append Text() but was unsuccessful.

 

mystring = " \[ // all my
                    // script
                       ]\" ;

myscript = dt<<New Script ("my script",
//some instructions
);
myscript  << Append Text (mystring)

Unfortunately this did not work. Any ideas ? Some tricks using Expr/ Eval , etc maybe ?

 

 

 

~~Bob~~
11 REPLIES 11
XanGregg
Staff

Re: How to keep formatting and comments with New Script () ?

JSL Quote() might help:

 

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

Re: How to keep formatting and comments with New Script () ?

well, well, well, it looks like we have a winner !

 

I love it when you spend days grinding your gears on a seemingly impossible problem and then someone reveals the solution to be a one line script :face_with_tears_of_joy:

 

thanks a lot @XanGregg :)

 

 

 

~~Bob~~

Recommended Articles