Today I am trying to close all but a select number of data tables as a repeating procedure is run using Data Table Name variables. I have three tables. One where results are collected, one where invalid results of the first table are collected, and one that the user opens for the script to know what ID values to use to compare. I found a Discussion where tables can be closed (it has been included in my script here), but it uses quoted text in a list for the table names. Since my users will be choosing a different data table for each iteration for the third table, how can I use a data table name variable to include it in the list and leave it open at the end of processing?
DontClose = {CompareTable, CollectionTable, IDTable}; // Example names of tables you want to leave open
//CompareTable = "Validation Table"
//Collection Table = "Unmatched Values"
//IDTable = could be anything but I want to leave this open once the processing loop is completed
// Loop backwards through the list, so the table numbers do not change
For( i = N Table(), i > 0, i--,
print( Data Table(i) << Get Name ) ;
If( Contains( DontClose, Data Table( i ) << get name ),
Continue(),
Close( Data Table( i ), "No Save" )
)
);