JSL_open 並從 for 循環中的列表連接數據表您好,我正在嘗試編寫一個腳本來在 JSL 中加入表,我們可以在其中輸入要加入的表的數量。 為此,我創建了列表來輸入 html 表格位置、表格名稱和連接列。
在加入之前,我首先打開表,在 for 循環中從列表中獲取一個元素。
我收到一條錯誤消息“訪問或評估“tables_list[i]”時出現下標問題,tables_list[/*###*/]。
知道我做錯了什麼嗎? 預先感謝您的支持
// Indicate how many input data tables you have (default = 1)
nb_join_tables = 2;
// Indicate here the link to the first input HTML table
input_table_01 = "http://xxxx.html";
// Indicate here the names you want for your first JMP data tables
JMP_table_01_name = "xxx -01";
// Indicate here the link to the input HTML table to join
input_table_02 = "http://xxxx.html";
input_table_03 = "http://xxxx.html";
// Indicate here the names you want for the data tables to join
JMP_table_02_name = "xxx -02";
JMP_table_03_name = "xxx -03";<BR /><BR />// indicate here the column you want JMP to use as joiner for the tables merge (default:Parameter Set Name)<BR />joiner_table_01 = "Parameter Set Name";<BR />joiner_table_02 = "Parameter Set Name";<BR />joiner_table_03 = "Parameter Set Name";
// Create lists according to the number of tables to merge
tables_list = {input_table_01,input_table_02,input_table_03};
names_list= {JMP_table_01_name,JMP_table_02_name,JMP_table_03_name};
joiners_list = {joiner_table_01,joiner_table_02,joiner_table_03};
For( i = 0, i <= nb_join_tables, i++,
//Open html data table from specific location
dt=Open(
tables_list[i],
HTML Table( 4, Column Names( 0 ), Data Starts( 1 ) )
);
// Set JMP data table name to the desired one
dt << Set Name( names_list[i] );
);腳本回复:JSL_open 並從 for 循環中的列表連接數據表太好了,謝謝,有效!!
回复:JSL_open 並從 for 循環中的列表連接數據表這段代碼
tables_list = {input_table_01,input_table_02,input_table_03};列出變量名稱,而不是變量內容的列表。 Open 正在查看它期望內容的變量的名稱。 您可以使用它來評估名稱的內容:
tables_list = Eval List( {input_table_01,input_table_02,input_table_03} );或者您可以像這樣構建列表:
tables_list = {};
tables_list[1] = input_table_01;
tables_list[2] = input_table_02;
tables_list[3] = input_table_03;回复:JSL_open 並從 for 循環中的列表連接數據表這是日誌:
我 = 1;
表列表 = {input_table_01,input_table_02,input_table_03,input_table_04,input_table_05,input_table_06};
input_table_01
Open 參數必須是訪問或評估 'Open' 時的字符串,Open/*###*/(tables_list[i], HTML Table(4, Column Names(0), Data Starts(1)))
回复:JSL_open 並從 for 循環中的列表連接數據表在它失敗的地方之前添加一個調試語句:
For( i = 0, i <= nb_join_tables, i++,
show(i, tables_list); // check the log window for the output
//Open html data table from specific location
dt=Open(
tables_list[i],
HTML Table( 4, Column Names( 0 ), Data Starts( 1 ) )
);
// Set JMP data table name to the desired one
dt << Set Name( names_list[i] );
);
回复:JSL_open 並從 for 循環中的列表連接數據表你好,克雷格,
我也嘗試了 n= 1 ,但它也不起作用。 實際上,我已經把 i=1 放在開頭並測試到 i=0 以防萬一,在發布之前忘記再次放置 i=1 。
不過似乎不是問題。
還有什麼想法嗎?
回复:JSL_open 並從 for 循環中的列表連接數據表JSL 列表和矩陣從 1 開始。 JMP 使用 for( i = 1, i <= n, i++, ... 而不是 for( i = 0, i < n, i++, .