cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

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

How to automatically write code containing /**/ to JSL?

For example, I use the following JSL to automatically generate a table script file in a data table.
But how to write the code containing /**/ into the script file of this table?

Thanks!

dt=Open("$SAMPLE_DATA/Big Class.jmp");
Eval(Parse("dt<<new script(\!"test\!",  dt<<Select Where(age==12);d3=dt<<Subset(Output Table(\!"age12\!"),Selected Rows(1),selected columns(0));try(d3<<Delete Table Property(\!"Source\!"));  );"));

2024-06-30_17-35-05.png

 

  • For example, insert code like /**/

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Eval(
	Parse(
		"dt<<new script(\!"test\!",  dt<<Select Where(age==12);d3=dt<<Subset(Output Table(\!"age12\!"),Selected Rows(1),selected columns(0));try(d3<<Delete Table Property(\!"Source\!")); /*d3<<Sort(By( height ),Order(Descending),replace table);*/ );"	
	)
);
3 REPLIES 3
lala
Level IX

Re: How to automatically write code containing /**/ to JSL?

Achieve the effect

2024-06-30_17-48-47.png

jthi
Super User

Re: How to automatically write code containing /**/ to JSL?

I'm not sure if this is directly possible, but you can use workaround combining Eval(Parse(JSL Quote)))

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt << New Script("Test",
	Eval(Parse(JSL Quote(
		/*
			Current Data Table() << Sort By(:height);
		*/
		show(1);
	)));
);

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

Preserve comments and whitespace in JSL code attached to data table 

-Jarmo
lala
Level IX

Re: How to automatically write code containing /**/ to JSL?

Thanks!

Looks like it has to be this way

2024-06-30_18-33-07.png

Recommended Articles