cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

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