你好
我真的很不擅長編碼。 我有一個腳本,它打開多個表子集,附加它並創建一個控製圖。 問題是創建了多個子表並保持打開狀態。
所有表名都以字符串“subset”開頭。 如何一次關閉所有表?
我建議在不需要使用 Close(datatablereference, No Save) 後立即關閉數據表,但很可能需要更多的腳本來將它們添加到正確的位置。
所以這是一個腳本,它應該關閉所有以子集開頭的數據表:
Names Default To Here(1);
tableList = Get Data Table List(); //get names of all tables
for(i = 1, i <= N Items(tableList), i++,
//get name of current table in list
currentTableName = tableList[i] << Get Name;
//check if table starts with subset. Use Lowercase() to take care of different way of naming "subset"
isSubsetTable = Starts With(Lowercase(currentTableName), "subset");
If(isSubsetTable,
Try(
Close(tableList[i], no save);
Print("Closed data table: " || currentTableName ||"."),
show(exception_msg)); //try to close
);
);