將腳本從一個數據表複製到另一個數據表<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />我希望能夠獲取存儲在一個表 (A) 中的腳本並在另一個表 (B) 中使用它們。 我怎樣才能做到這一點? 我需要能夠在 JSL 中編寫此代碼。
或者,如何將存儲在我的計算機上的腳本(JSL 文件)添加到數據表中?
這類似於另一個用戶關於將腳本從圖形添加到表的問題。 不幸的是,我認為在我的情況下不能使用“獲取腳本”命令,因為我不需要創建表的腳本,我想要一個存儲在表中的腳本。
謝謝你!
凱蒂
回复:將腳本從一個數據表複製到另一個數據表@大衛_伯納姆用於從數據表獲取所有腳本的腳本似乎在第 9 行缺少 [i]:
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = new table("little class");
lstScriptNames = dt << Get Table Script Names();
For (i=1,i<=NItems(lstScriptNames),i++,
scriptName = lstScriptNames[i];
scriptDef = dt << get table variable(scriptName);
Eval(Parse(Eval Insert( "\[
dt2 << New Script( "^scriptName^", ^scriptDef^ )
]\")));
)將腳本從一個數據表複製到另一個數據表非常感謝!這奏效了。
我認為添加到 JMP 的一個不錯的功能是允許將腳本作為文件或引用添加到 JMP 表中 - 消除對 eval 語句的需要。
將腳本從一個數據表複製到另一個數據表如果您想複製特定腳本,可以使用以下代碼:
dt = Open("$SAMPLE_DATA/Big Class.jmp");
scriptName = "Oneway";
scriptDef = dt << get table variable(scriptName);
dt2 = new table("little class");
Eval(Parse(Eval Insert( "\[
dt2 << New Script( "^scriptName^", ^scriptDef^ )
]\")));
If you want to copy all of the scripts then you can do this:
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = new table("little class");
lstScriptNames = dt << Get Table Script Names;
For (i=1,i<=NItems(lstScriptNames),i++,
scriptName = lstScriptNames;
scriptDef = dt << get table variable(scriptName);
Eval(Parse(Eval Insert( "\[
dt2 << New Script( "^scriptName^", ^scriptDef^ )
]\")));
)
-戴夫