취소
다음에 대한 결과 표시 
표시  만  | 다음에 대한 검색 
다음을 의미합니까? 

Discussions

Solve problems, and share tips and tricks with other JMP users.
언어 선택 변환 막대 숨기기
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 응답 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

추천 글