你好,
所以我试图做一些相当简单的事情,但是行选择出现了奇怪的行为。
所以我得到了一张包含一些混料设计数据的表格。 我有 12 列用于 12 种不同的混合物成分。 每行有三列,告诉它们存在哪三个组件,名为 comp A、comp B、comp C。
这些跑步活动被分为多个系列,并以字母 A 到 K 命名。 我想制作一个脚本来同时运行一堆拟合模型。 为此,我需要使用正确的行创建子表。 基本上使用 :Series 列一一选择每个系列。 我的问题是,也有一些线路只有一个组件。 我制作了以下脚本。
Names Default To Here( 1 );
Delete Symbols();
mytable = Current Data Table();
Serieslist = {} ;
For Each Row(
If(
:Series !="X" & !Contains item (:Series, Serieslist),
Serieslist = Insert (Serieslist, :Series)
);
);
mytable << clear selected row states ();
Letter = Serieslist [1];
mytable << Row Selection( Select where (:Series == Letter) );
S1 = :Comp A[mytable<<GET selected="" rows=""></GET>现在,当我尝试使用正确的线条进行选择时,它无法按应有的方式工作。 使用一堆 Print() 指令,我确保我的值是正确的。
现在检查以下代码:
</CODE></PRE><P> </P><PRE><CODE class=" language-jsl">mytable << Row Selection( Select where (:Ref == complist[1]) );
wait (2);
mytable << Row Selection( Select where (:Ref == complist[2]) );
wait (2);
mytable << Row Selection( Select where (:Ref == complist[3]) );
wait (2);
mytable << Row Selection( Select where (:Ref == complist[1]) );
wait (2);
mytable << Row Selection( Select where (:Ref == complist[2]), current selection ("extend") );
wait (2);
mytable << Row Selection( Select where (:Ref == complist[3]), current selection ("extend") );
mytable << Row Selection( Select where (:Ref == complist[1]) );
wait (2);
mytable << Row Selection( Select where (:Ref == "comp 6"), current selection ("extend") );
wait (2);
mytable << Row Selection( Select where (:Ref == "comp 12"), current selection ("extend") );
前三个指令确实选择了正确的行。 但是当我尝试选择多行时,使用当前选择(“扩展”)争论,这是行不通的。 我错过了什么吗?
在最后一行,当我在 select where () 参数中手动写入一个值时,它确实可以工作,但是当代码必须对“==”进行评估时,它就会停止工作。 有人有解决办法吗? 我很确定有更好的方法可以做到这一点,但我仍然想了解为什么它不起作用。 是 Eval Parse 的问题吗?
我已附上数据表和脚本。