Choose Language Hide Translation Bar
Highlighted
midori555
Level II

save New Window scripts into data table

I have a lengthy new window script generated by Fit Y by X. It looks like:

 

New Window( "y vs x",
V List Box(
Fit Group(
Bivariate(
Y( :yy ),
X( :xx ),
.......

 

 

I tried to save the new window script in the data table using:

 

win = New Window( "y vs x",
V List Box(
Fit Group(
Bivariate(
Y( :yy ),
X( :xx ),
.......

dt << New Table Script( "y vs x", win<<get script() );

 

But that didn't work.

Instead of copying the whole script into the jsl_expression in the New Table Script I'm looking for something that's more concise.

Thanks for any help! 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: save New Window scripts into data table

While @cwillden code will save the script for the New Window(), the unfortunate item is that there are issues with the script created in JMP from a New Window().

I have been more successful in creating in the JSL, an expression of  the script I am going to create, and then running the script from the expression, and then secondly, converting the literal string and saving it as a script to the data table.

Names Default To Here( 1 );
dt = Current Data Table();

x = Expr(
	win = New Window( "y vs x",
		V List Box(
			Fit Group( Bivariate( Y( :height ), X( :weight ) ) )
		)
	)
);
Eval( x );
Eval(
	Substitute(
			Expr(
				dt << New Script( "y vs x", __x__ )
			),
		Expr( __x__ ), Eval Expr( x )
	)
);

 

Jim

View solution in original post

3 REPLIES 3
Highlighted
cwillden
Super User

Re: save New Window scripts into data table

The problem is the table will literally contain the script "win << get script()" so that script will no longer work once that window named "win" has been closed.  Try this:

Eval(
	Parse(
		Eval Insert( "\[dt << New Table Script("y vs. x", ^win << get script^)]\" )
	)
);
-- Cameron Willden
Highlighted
txnelson
Super User

Re: save New Window scripts into data table

While @cwillden code will save the script for the New Window(), the unfortunate item is that there are issues with the script created in JMP from a New Window().

I have been more successful in creating in the JSL, an expression of  the script I am going to create, and then running the script from the expression, and then secondly, converting the literal string and saving it as a script to the data table.

Names Default To Here( 1 );
dt = Current Data Table();

x = Expr(
	win = New Window( "y vs x",
		V List Box(
			Fit Group( Bivariate( Y( :height ), X( :weight ) ) )
		)
	)
);
Eval( x );
Eval(
	Substitute(
			Expr(
				dt << New Script( "y vs x", __x__ )
			),
		Expr( __x__ ), Eval Expr( x )
	)
);

 

Jim

View solution in original post

Highlighted
midori555
Level II

Re: save New Window scripts into data table

Thanks Jim. It works!
Article Labels

    There are no labels assigned to this post.