我有一個保存的 jmp 腳本。我們就這樣稱呼它吧my_graph.jsl 。我想獲取該腳本並將其作為 New Script() 新增到我目前的資料表中。我知道
dt << New Script(scriptname, code)
將向資料表新增一個腳本。但我不清楚如何取得內容my_graph.jsl並將其傾倒在那裡。我嘗試過玩載入文字檔()但我不知道該怎麼辦。我想解決方案將涉及以下一些組合求值/表達式/求值表達式但老實說,我從來沒有認真思考過那些有意義的順序:\
這是使用 Include(, << Parse Only) 的另一個選項
Names Default To Here(1);
script_path = "$DOWNLOADS/table_script.jsl";
txt = "Graph Builder(
Size(525, 454),
Show Control Panel(0),
Variables(X(:weight), Y(:height), Color(:sex)),
Elements(Points(X, Y, Legend(5)))
);";
Save Text File(script_path, txt);
txt = "";
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Eval(EvalExpr(
dt << New Script("Plot Graph", Expr(Include(script_path, << Parse Only)))
));
關於 eval/eval expr 等的一些鏈接
- https://community.jmp.com/t5/JSL-Cookbook/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/ta-p/48998
- https://community.jmp.com/t5/JMPer-Cable/Expression-Handling-Functions-Part-I-Unraveling-the-Expr/ba-p/28963
- https://community.jmp.com/t5/Discussions/Can-you-construct-this-without-writing-expression-as-a-string/td-p/369323
是的,這是一個曲折的
也許是這樣的?
obj=open("/Users/bywing/Byron Wingerd/Examples/eraseme.jsl");
stuff=obj<<GET text=""></GET>