cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
shasha_2
Level III

JSL scripting query regarding jmp table call

I want to call a table which I am using in the current JSL script into another script, is there any way in which I can do that? I have attached snippet of the code, I want to use the dt1_Name (or dt) in another jsl script which I have linked to this script:

dt1_Name= Pick File(
	"Select the JMP MasterFile",
	"", 
	{"JMP Files|jmp;jsl;jrn", "All Files|*"},
	1,
	0,
	"" 
);
Show( dt1_Name ); 
dt = Open( dt1_Name ); 
Show( dt ); 

bwidth = 150;

dt << bring window to front;
box_win = New Window( "Select Columns",
	H List Box(
		Panel Box( "Select Columns", ColListData = Col List Box( dt, All, Grouped,width( bwidth ), nLines( 5 ) ) ),
		V List Box(
			Panel Box( "Case Selected Columns Into Roles",
				Lineup Box( N Col( 2 ), Spacing( 3 ),
					Button Box( "START DATE", colLista << Append( ColListData << Get Selected ) ),
					ColLista = Col List Box( width( bwidth ), N Lines( 1 ), Max Items( 1 ), Min Items( 1 ) ),
					Button Box( "END DATE", colListb << Append( ColListData << Get Selected ) ),
					ColListb = Col List Box( width( bwidth ), N Lines( 1 ), Max Items( 1 ), Min Items( 1 ) ),
					Button Box( "PAY DATE", colListc << Append( ColListData << Get Selected ) ),
					ColListc = Col List Box( width( bwidth ), N Lines( 1 ), Max Items( 1 ), Min Items( 1 )),
					Button Box( "STATUS", colListd << Append( ColListData << Get Selected ) ),
					ColListd = Col List Box( width( bwidth ), N Lines( 1 ), Max Items( 1 ), Min Items( 1 ) ),
					Button Box( "Remove",
						ColLista << RemoveSelected;
						ColListb << RemoveSelected;
						ColListc << RemoveSelected;
					),
					Spacer Box()
				)
			),
			Lineup Box( N Col( 3 ), Spacing( 0, 3 ),
				Spacer Box( <<Set Auto Stretching( 1, 0 ) ),
				Button Box( "OK",
					acol = ColLista << Get Items;
					As Column( acol ) << Set Name( "STARTDATE" );
					bcol = ColListb << Get Items;
					As Column( bcol ) << set name( "ENDDATE" );
					ccol = ColListc << Get Items;
					As Column( ccol ) << set name( "PAY DATE" );
					dcol = ColListd << Get Items;
					As Column( dcol ) << set name( "STATUS" );
					box_win << Close Window;	
					); 
					Close( dt, Save );
					Include("$Desktop/nextstep.jsl");
					
				),
				Button Box( "Cancel", box_win << Close Window )
			)
		)

	)
);
1 ACCEPTED SOLUTION

Accepted Solutions
pauldeen
Level VI

Re: JSL scripting query regarding jmp table call

If your first script looks like this:

Names default to here(1);
a = 1;
::b = 2;

From a second script, notice you can look at the b variable because it has been globally scoped with the :: operator in front of it.

Names default to here(1);
try(show(a));
try(show(::b));

So as long as you define your table variable as globally scoped, you should be able to call it from other scripts.

View solution in original post

6 REPLIES 6
jthi
Super User

Re: JSL scripting query regarding jmp table call

Depending how you have built your script(s), using Namespaces might work.

-Jarmo
txnelson
Super User

Re: JSL scripting query regarding jmp table call

If you start off each script with

Names Default to Here( 1 );

All of the variables etc. in that specific script will be unique to that script, and only that script.

Jim
shasha_2
Level III

Re: JSL scripting query regarding jmp table call

Thank you

shasha_2
Level III

Re: JSL scripting query regarding jmp table call

Thank you!

pauldeen
Level VI

Re: JSL scripting query regarding jmp table call

If your first script looks like this:

Names default to here(1);
a = 1;
::b = 2;

From a second script, notice you can look at the b variable because it has been globally scoped with the :: operator in front of it.

Names default to here(1);
try(show(a));
try(show(::b));

So as long as you define your table variable as globally scoped, you should be able to call it from other scripts.

shasha_2
Level III

Re: JSL scripting query regarding jmp table call

Thank you, it's working!