Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
BR-KA
Level I

two separate scripts not working when combined

Hello,

 

I have a problem of combining two scripts. Below is an example. First part is to import multiple files. Second part is to use the table created by the first part. They work fine when they are run separately in series, but when combied it says in the log that "tbl" is not defined. Could you help me on this? I'd like to use the "multiple file import" dialogue to select certain CSV files(instead of using "<< Import data;" with preset conditions), and then run a script for data display. 

 

mfi = Multiple File Import() << Create window;

 

tbl = Current Data Table();
tbl:File Date << Data Type( Character );

2 REPLIES 2
Highlighted
cwillden
Super User

Re: two separate scripts not working when combined

Your problem is that the script is not waiting for you to make your selections in the Multiple File Import window before it moves on the the next lines. Therefore, it is trying to define tbl before any data tables are open.

 

Here's a solution. Set an On Close script for mfi so that the remaining part of the script only runs when you close the mfi window.

mfi = Multiple File Import() << Create window;

mfi << On Close(
	tbl = Current Data Table();
	tbl:File Date << Data Type( Character );
);
-- Cameron Willden
Highlighted
BR-KA
Level I

Re: two separate scripts not working when combined

Thanks! It works!

Article Labels

    There are no labels assigned to this post.