如何在 Outlinebox[ text()='text'] 中使用变量嘿大家,
我遇到了一些代码问题。
MinParam=(report << XPath("//OutlineBox[text()='min']//OutlineBox[text()=mindist]//StringColBox[StringColBoxHeader[text()='Parameter']]"))<<GET></GET>Here the variable is "mindist" and it equals "Normal 2 Mixtures". However, I can't get it to work.
Any suggestions?
Thanks!
Steve
<LINGO-LABS id="lingo-labs-819647" slang="en-US" mode="CREATE"><LINGO-LABEL>自动化和脚本</LINGO-LABEL></LINGO-LABS>回复:如何在 Outlinebox 中使用变量[text()='text']你可以将它构建到字符串中
xpath_query = "//OutlineBox[text()='min']//OutlineBox[text()='" || mindist || "']//StringColBox[StringColBoxHeader[text()='Parameter']]";
MinParam = (report << XPath(xpath_query)) << get;
或者更好的方法是使用 Eval Insert
xpath_query_template = "//OutlineBox[text()='min']//OutlineBox[text()='¤mindist¤']//StringColBox[StringColBoxHeader[text()='Parameter']]";
xpath_query = Eval Insert(xpath_query_template, "¤");
MinParam = (report << XPath(xpath_query)) << get;
回复:如何在 Outlinebox 中使用变量[text()='text']谢谢@jthi !
有效!我还意识到这 3 种混合物的名称不同,因为它在末尾添加了分布,所以这可能是真正的问题,但现在我有了更多选择。

对于选项 2,这些是什么?
"¤"
回复:如何在 Outlinebox 中使用变量[text()='text']
回复:如何在 Outlinebox 中使用变量[text()='text']我使用“非默认”的起始/结束字符(用于指示要替换变量的位置),因为 ^ 在文本中出现得太频繁(主要是它会干扰使用正则表达式的任何内容)。Eval Insert(string, , ,< < ) 。
您还可以使用包含来代替文本。语法如下(XPath 中还有 starts-with 等等)
Report(dist) << XPath("//OutlineBox[contains(text(), 'Fitted Normal 3 Mixture')]//StringColBox[StringColBoxHeader[text()='Parameter']]");
如果您只需要访问单个拟合正态 3 混合分布和其下的字符串 col 框,使用报告下标可能比 XPath 更容易。它也支持通配符,但它在功能上比 XPath 更有限(有时仍然有用), 获取对显示框对象的引用通过下标/通配符字符串创建引用
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cytometry.jmp");
dist = dt << Distribution(Column(:CD8));
dist << Fit Normal 3 Mixture;
scb = Report(dist)[OutlineBox("Fitted Normal ? Mixture ?"), StringColBox("Parameter")];
scb << get;