我有一个保存的 jmp 脚本。让我们称之为我的图表.jsl .我想获取该脚本并将其作为 New Script() 添加到我当前的数据表中。我知道
dt << New Script(scriptname, code)
将向数据表添加一个新脚本。但是我不清楚如何获取的内容我的图表.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>