你好,
所以我試圖做一些相當簡單的事情,但是行選擇出現了奇怪的行為。
所以我得到了一張包含一些混料設計數據的表格。 我有 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 的問題嗎?
我已附上數據表和腳本。