two separate scripts not working when combinedHello,
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 );
Re: two separate scripts not working when combinedYour 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 );
);
Re: two separate scripts not working when combinedThanks! It works!