所有平台物件的列表?如果我使用 By 變數透過 JSL 產生平台,則傳回值是所有產生的可編寫腳本的物件的清單。
如果我僅使用平台命令打開對話框 - 然後在用戶單擊“確定”後,什麼是快速且可靠的方法來獲取生成的所有可編寫腳本的對象的列表?
就像是
(current report() << xpath("//OutlineBox")) << get scriptable object()……透過巧妙的 OutlneBoxes 預選,這是有意義的 - 通用預選,無需針對個別情況進行調整。
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window("test",V List Box(
dist1=Distribution (by( :age ))), // return value: list of the scriptable objects
dist2 = Distribution(
Continuous Distribution(Column( :height )),
By( :age )
));自動化和腳本編寫回覆:所有平台物件的列表?我認為測試不同的平台並嘗試確定健壯的 XPath 將是一種選擇。
回覆:所有平台物件的列表?正在努力:)
我希望有人在 5 年前就已經這樣做了,並且可以直接提供解決方案...
回覆:所有平台物件的列表?顯示框清單是否有「刪除重複」功能?
標準方法透過
associative array () << get keys
似乎不起作用。
回覆:所有平台物件的列表?如果相當確定,如果您獲得所有輪廓框,那麼您實際上不會有重複項,因為它們確實引用了不同的物件。
如果您查看使用 By 變數創建的幾個不同平台,您很可能會看到共同的東西
分配:

單程:

圖形產生器(使用「依變數」建立的情況較為罕見):

你有 HeadBox、ListBox 和 OutlineBox(在 Graph Builder 中,我認為正確的顯示框是 OwnerBox),它們有特定的順序。 OutlineBox/OwnerBox 也有 helpKey 屬性。
回覆:所有平台物件的列表?所以:
(current report() << xpath("//OutlineBox[@helpKey]"))回覆:所有平台物件的列表?我猜想使用 XPath 至少有時會為您帶來太多參考。 我想嘗試的是存取 OutlineBox 的第一個等級,它具有 ListBox 內的 helpKey 屬性。 不確定這是否適用於每個 JMP 平台,但希望這是一個起點
obs = (current report() << xpath("//ListBox//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]")) << get scriptable object();
回覆:所有平台物件的列表?謝謝,它有效:)
但不幸的是,它的速度相當慢。
因此,也許最好取得所有項目,然後詢問父項和 helpKey *)。
*)尚未工作...
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "test",
Outline Box( "main", Life Distribution( Perspective( Compare Groups ), Y( :weight ), Grouping( :sex ), By( :age ) ) )
);
t0 = HP Time();
list1 = Current Report() << xpath( "//OutlineBox[@helpKey]" );
Show( (HP Time() - t0) / 1000000 );
t0 = HP Time();
list2 = Current Report() << xpath( "//ListBox//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]" );
Show( (HP Time() - t0) / 1000000 );
t0 = HP Time();
firstResults = Current Report() << xpath( "//OutlineBox[@helpKey]" );
list3 = {};
For Each( {item, idx}, firstResults[{1, 2}],
found = Regex( (item << parent) << get xml(), "\A.*helpKey" ); //unfortunately not restricted to first line like should be !??!?!
If( Is Empty( item << parent ) | Is Missing( found ),
Insert Into( list3, item )
);
);
Show( (HP Time() - t0) / 1000000 );
(生命值時間() - t0) / 1000000 = 0.048218; // 沒有限制
(生命值時間() - t0) / 1000000 = 7.204071; // Xpath 一體化
(生命值時間() - t0) / 1000000 = 0.152291; // 手動後選擇
回覆:所有平台物件的列表?您很可能可以優化第二個 XPath。 幾點建議
//ListBox/*/OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]
或者
//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]
回覆:所有平台物件的列表?刪除本機資料過濾器(類別名稱:數據過濾器[] - 並不是“大綱框” 
collectedOutlineBoxObjects = (Current Report() << xpath( "//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey])]" )) << get scriptable object() ;
ListOfPlatFormObjects={};
For Each({item},collectedOutlineBoxObjects, If(item << class name =="OutlineBox", Insert Into(ListOfPlatFormObjects, item)));
回覆:所有平台物件的列表?您很可能只能使用純 XPath,因為資料過濾器確實具有作為 helpKey 的特定值(至少基於我的快速檢查)
//OutlineBox[@helpKey and not(@helpKey = 'Data Filter') and not(ancestor::OutlineBox[@helpKey])]
你也許可以只吃一個,但不行
//OutlineBox[@helpKey and not(ancestor::OutlineBox[@helpKey] or @helpKey = 'Data Filter')]